var Jg = Object.defineProperty,
  $g = Object.defineProperties;
var Zg = Object.getOwnPropertyDescriptors;
var er = Object.getOwnPropertySymbols;
var dl = Object.prototype.hasOwnProperty,
  pl = Object.prototype.propertyIsEnumerable;
var wn = (Y, X, J) => X in Y ? Jg(Y, X, {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: J
  }) : Y[X] = J,
  j = (Y, X) => {
    for (var J in X || (X = {})) dl.call(X, J) && wn(Y, J, X[J]);
    if (er)
      for (var J of er(X)) pl.call(X, J) && wn(Y, J, X[J]);
    return Y
  },
  se = (Y, X) => $g(Y, Zg(X));
var re = (Y, X) => {
  var J = {};
  for (var xe in Y) dl.call(Y, xe) && X.indexOf(xe) < 0 && (J[xe] = Y[xe]);
  if (Y != null && er)
    for (var xe of er(Y)) X.indexOf(xe) < 0 && pl.call(Y, xe) && (J[xe] = Y[xe]);
  return J
};
var P = (Y, X, J) => (wn(Y, typeof X != "symbol" ? X + "" : X, J), J);
(function (Y, X) {
  typeof exports == "object" && typeof module != "undefined" ? module.exports = X() : typeof define == "function" && define.amd ? define(X) : (Y = typeof globalThis != "undefined" ? globalThis : Y || self, Y.VE = X())
})(this, function () {
  "use strict";

  function Y(r) {
    return r != null && typeof r == "object" && r["@@functional/placeholder"] === !0
  }

  function X(r) {
    return function e(i) {
      return arguments.length === 0 || Y(i) ? e : r.apply(this, arguments)
    }
  }

  function J(r) {
    return function e(i, n) {
      switch (arguments.length) {
        case 0:
          return e;
        case 1:
          return Y(i) ? e : X(function (s) {
            return r(i, s)
          });
        default:
          return Y(i) && Y(n) ? e : Y(i) ? X(function (s) {
            return r(s, n)
          }) : Y(n) ? X(function (s) {
            return r(i, s)
          }) : r(i, n)
      }
    }
  }

  function xe(r, e) {
    switch (r) {
      case 0:
        return function () {
          return e.apply(this, arguments)
        };
      case 1:
        return function (i) {
          return e.apply(this, arguments)
        };
      case 2:
        return function (i, n) {
          return e.apply(this, arguments)
        };
      case 3:
        return function (i, n, s) {
          return e.apply(this, arguments)
        };
      case 4:
        return function (i, n, s, o) {
          return e.apply(this, arguments)
        };
      case 5:
        return function (i, n, s, o, a) {
          return e.apply(this, arguments)
        };
      case 6:
        return function (i, n, s, o, a, c) {
          return e.apply(this, arguments)
        };
      case 7:
        return function (i, n, s, o, a, c, h) {
          return e.apply(this, arguments)
        };
      case 8:
        return function (i, n, s, o, a, c, h, u) {
          return e.apply(this, arguments)
        };
      case 9:
        return function (i, n, s, o, a, c, h, u, d) {
          return e.apply(this, arguments)
        };
      case 10:
        return function (i, n, s, o, a, c, h, u, d, p) {
          return e.apply(this, arguments)
        };
      default:
        throw new Error("First argument to _arity must be a non-negative integer no greater than ten")
    }
  }

  function Cn(r, e, i) {
    return function () {
      for (var n = [], s = 0, o = r, a = 0; a < e.length || s < arguments.length;) {
        var c;
        a < e.length && (!Y(e[a]) || s >= arguments.length) ? c = e[a] : (c = arguments[s], s += 1), n[a] = c, Y(c) || (o -= 1), a += 1
      }
      return o <= 0 ? i.apply(this, n) : xe(o, Cn(r, n, i))
    }
  }
  var fl = J(function (e, i) {
      return e === 1 ? X(i) : xe(e, Cn(e, [], i))
    }),
    Ut = fl;

  function Ze(r) {
    return function e(i, n, s) {
      switch (arguments.length) {
        case 0:
          return e;
        case 1:
          return Y(i) ? e : J(function (o, a) {
            return r(i, o, a)
          });
        case 2:
          return Y(i) && Y(n) ? e : Y(i) ? J(function (o, a) {
            return r(o, n, a)
          }) : Y(n) ? J(function (o, a) {
            return r(i, o, a)
          }) : X(function (o) {
            return r(i, n, o)
          });
        default:
          return Y(i) && Y(n) && Y(s) ? e : Y(i) && Y(n) ? J(function (o, a) {
            return r(o, a, s)
          }) : Y(i) && Y(s) ? J(function (o, a) {
            return r(o, n, a)
          }) : Y(n) && Y(s) ? J(function (o, a) {
            return r(i, o, a)
          }) : Y(i) ? X(function (o) {
            return r(o, n, s)
          }) : Y(n) ? X(function (o) {
            return r(i, o, s)
          }) : Y(s) ? X(function (o) {
            return r(i, n, o)
          }) : r(i, n, s)
      }
    }
  }
  var Ci = Array.isArray || function (e) {
    return e != null && e.length >= 0 && Object.prototype.toString.call(e) === "[object Array]"
  };

  function ml(r) {
    return r != null && typeof r["@@transducer/step"] == "function"
  }

  function xi(r, e, i) {
    return function () {
      if (arguments.length === 0) return i();
      var n = Array.prototype.slice.call(arguments, 0),
        s = n.pop();
      if (!Ci(s)) {
        for (var o = 0; o < r.length;) {
          if (typeof s[r[o]] == "function") return s[r[o]].apply(s, n);
          o += 1
        }
        if (ml(s)) {
          var a = e.apply(null, n);
          return a(s)
        }
      }
      return i.apply(this, arguments)
    }
  }

  function xn(r) {
    return r && r["@@transducer/reduced"] ? r : {
      "@@transducer/value": r,
      "@@transducer/reduced": !0
    }
  }
  var xt = {
      init: function () {
        return this.xf["@@transducer/init"]()
      },
      result: function (r) {
        return this.xf["@@transducer/result"](r)
      }
    },
    gl = function () {
      function r(e, i) {
        this.xf = i, this.f = e, this.all = !0
      }
      return r.prototype["@@transducer/init"] = xt.init, r.prototype["@@transducer/result"] = function (e) {
        return this.all && (e = this.xf["@@transducer/step"](e, !0)), this.xf["@@transducer/result"](e)
      }, r.prototype["@@transducer/step"] = function (e, i) {
        return this.f(i) || (this.all = !1, e = xn(this.xf["@@transducer/step"](e, !1))), e
      }, r
    }(),
    yl = J(function (e, i) {
      return new gl(e, i)
    }),
    vl = yl,
    _l = J(xi(["all"], vl, function (e, i) {
      for (var n = 0; n < i.length;) {
        if (!e(i[n])) return !1;
        n += 1
      }
      return !0
    })),
    bn = _l;

  function bi(r, e) {
    for (var i = 0, n = e.length, s = Array(n); i < n;) s[i] = r(e[i]), i += 1;
    return s
  }

  function tr(r) {
    return Object.prototype.toString.call(r) === "[object String]"
  }
  var wl = X(function (e) {
      return Ci(e) ? !0 : !e || typeof e != "object" || tr(e) ? !1 : e.nodeType === 1 ? !!e.length : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1
    }),
    Cl = wl,
    xl = function () {
      function r(e) {
        this.f = e
      }
      return r.prototype["@@transducer/init"] = function () {
        throw new Error("init not implemented on XWrap")
      }, r.prototype["@@transducer/result"] = function (e) {
        return e
      }, r.prototype["@@transducer/step"] = function (e, i) {
        return this.f(e, i)
      }, r
    }();

  function bl(r) {
    return new xl(r)
  }
  var Al = J(function (e, i) {
      return xe(e.length, function () {
        return e.apply(i, arguments)
      })
    }),
    Pl = Al;

  function Sl(r, e, i) {
    for (var n = 0, s = i.length; n < s;) {
      if (e = r["@@transducer/step"](e, i[n]), e && e["@@transducer/reduced"]) {
        e = e["@@transducer/value"];
        break
      }
      n += 1
    }
    return r["@@transducer/result"](e)
  }

  function An(r, e, i) {
    for (var n = i.next(); !n.done;) {
      if (e = r["@@transducer/step"](e, n.value), e && e["@@transducer/reduced"]) {
        e = e["@@transducer/value"];
        break
      }
      n = i.next()
    }
    return r["@@transducer/result"](e)
  }

  function Pn(r, e, i, n) {
    return r["@@transducer/result"](i[n](Pl(r["@@transducer/step"], r), e))
  }
  var Sn = typeof Symbol != "undefined" ? Symbol.iterator : "@@iterator";

  function ir(r, e, i) {
    if (typeof r == "function" && (r = bl(r)), Cl(i)) return Sl(r, e, i);
    if (typeof i["fantasy-land/reduce"] == "function") return Pn(r, e, i, "fantasy-land/reduce");
    if (i[Sn] != null) return An(r, e, i[Sn]());
    if (typeof i.next == "function") return An(r, e, i);
    if (typeof i.reduce == "function") return Pn(r, e, i, "reduce");
    throw new TypeError("reduce: list must be array or iterable")
  }
  var Tl = function () {
      function r(e, i) {
        this.xf = i, this.f = e
      }
      return r.prototype["@@transducer/init"] = xt.init, r.prototype["@@transducer/result"] = xt.result, r.prototype["@@transducer/step"] = function (e, i) {
        return this.xf["@@transducer/step"](e, this.f(i))
      }, r
    }(),
    Ml = J(function (e, i) {
      return new Tl(e, i)
    }),
    El = Ml;

  function je(r, e) {
    return Object.prototype.hasOwnProperty.call(e, r)
  }
  var Tn = Object.prototype.toString,
    Dl = function () {
      return Tn.call(arguments) === "[object Arguments]" ? function (e) {
        return Tn.call(e) === "[object Arguments]"
      } : function (e) {
        return je("callee", e)
      }
    }(),
    kl = Dl,
    zl = !{
      toString: null
    }.propertyIsEnumerable("toString"),
    Mn = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"],
    En = function () {
      return arguments.propertyIsEnumerable("length")
    }(),
    Il = function (e, i) {
      for (var n = 0; n < e.length;) {
        if (e[n] === i) return !0;
        n += 1
      }
      return !1
    },
    Ol = X(typeof Object.keys == "function" && !En ? function (e) {
      return Object(e) !== e ? [] : Object.keys(e)
    } : function (e) {
      if (Object(e) !== e) return [];
      var i, n, s = [],
        o = En && kl(e);
      for (i in e) je(i, e) && (!o || i !== "length") && (s[s.length] = i);
      if (zl)
        for (n = Mn.length - 1; n >= 0;) i = Mn[n], je(i, e) && !Il(s, i) && (s[s.length] = i), n -= 1;
      return s
    }),
    bt = Ol,
    Rl = J(xi(["fantasy-land/map", "map"], El, function (e, i) {
      switch (Object.prototype.toString.call(i)) {
        case "[object Function]":
          return Ut(i.length, function () {
            return e.call(this, i.apply(this, arguments))
          });
        case "[object Object]":
          return ir(function (n, s) {
            return n[s] = e(i[s]), n
          }, {}, bt(i));
        default:
          return bi(e, i)
      }
    })),
    Bl = Rl,
    rr = Number.isInteger || function (e) {
      return e << 0 === e
    },
    Ll = J(function (e, i) {
      var n = e < 0 ? i.length + e : e;
      return tr(i) ? i.charAt(n) : i[n]
    }),
    Gl = Ll,
    Fl = J(function (e, i) {
      return e.map(function (n) {
        for (var s = i, o = 0, a; o < n.length;) {
          if (s == null) return;
          a = n[o], s = rr(a) ? Gl(a, s) : s[a], o += 1
        }
        return s
      })
    }),
    Hl = Fl,
    Nl = J(function (e, i) {
      return Hl([e], i)[0]
    }),
    Dn = Nl,
    Ul = Ze(ir),
    kn = Ul,
    Vl = X(function (e) {
      return function () {
        return e
      }
    }),
    Wl = Vl,
    jl = function () {
      function r(e, i) {
        this.xf = i, this.f = e, this.any = !1
      }
      return r.prototype["@@transducer/init"] = xt.init, r.prototype["@@transducer/result"] = function (e) {
        return this.any || (e = this.xf["@@transducer/step"](e, !1)), this.xf["@@transducer/result"](e)
      }, r.prototype["@@transducer/step"] = function (e, i) {
        return this.f(i) && (this.any = !0, e = xn(this.xf["@@transducer/step"](e, !0))), e
      }, r
    }(),
    ql = J(function (e, i) {
      return new jl(e, i)
    }),
    Ql = ql,
    Yl = J(xi(["any"], Ql, function (e, i) {
      for (var n = 0; n < i.length;) {
        if (e(i[n])) return !0;
        n += 1
      }
      return !1
    })),
    zn = Yl,
    Xl = Ze(function (e, i, n) {
      var s = {};
      for (var o in n) s[o] = n[o];
      return s[e] = i, s
    }),
    Kl = Xl,
    Jl = X(function (e) {
      return e == null
    }),
    nr = Jl,
    $l = Ze(function r(e, i, n) {
      if (e.length === 0) return i;
      var s = e[0];
      if (e.length > 1) {
        var o = !nr(n) && je(s, n) ? n[s] : rr(e[1]) ? [] : {};
        i = r(Array.prototype.slice.call(e, 1), i, o)
      }
      if (rr(s) && Ci(n)) {
        var a = [].concat(n);
        return a[s] = i, a
      } else return Kl(s, i, n)
    }),
    Zl = $l;

  function ec(r) {
    var e = Object.prototype.toString.call(r);
    return e === "[object Function]" || e === "[object AsyncFunction]" || e === "[object GeneratorFunction]" || e === "[object AsyncGeneratorFunction]"
  }
  var tc = X(function (e) {
      return Ut(e.length, e)
    }),
    ic = tc,
    rc = ic(function (e) {
      return e.apply(this, Array.prototype.slice.call(arguments, 1))
    }),
    nc = rc;

  function sc(r) {
    return new RegExp(r.source, (r.global ? "g" : "") + (r.ignoreCase ? "i" : "") + (r.multiline ? "m" : "") + (r.sticky ? "y" : "") + (r.unicode ? "u" : ""))
  }
  var oc = X(function (e) {
      return e === null ? "Null" : e === void 0 ? "Undefined" : Object.prototype.toString.call(e).slice(8, -1)
    }),
    sr = oc;

  function In(r, e, i, n) {
    var s = function (a) {
      for (var c = e.length, h = 0; h < c;) {
        if (r === e[h]) return i[h];
        h += 1
      }
      e[h + 1] = r, i[h + 1] = a;
      for (var u in r) a[u] = n ? In(r[u], e, i, !0) : r[u];
      return a
    };
    switch (sr(r)) {
      case "Object":
        return s({});
      case "Array":
        return s([]);
      case "Date":
        return new Date(r.valueOf());
      case "RegExp":
        return sc(r);
      default:
        return r
    }
  }
  var ac = X(function (e) {
      return e != null && typeof e.clone == "function" ? e.clone() : In(e, [], [], !0)
    }),
    lc = ac,
    cc = X(function (e) {
      return !e
    }),
    hc = cc;

  function uc(r, e) {
    return function () {
      return e.call(this, r.apply(this, arguments))
    }
  }

  function On(r, e) {
    return function () {
      var i = arguments.length;
      if (i === 0) return e();
      var n = arguments[i - 1];
      return Ci(n) || typeof n[r] != "function" ? e.apply(this, arguments) : n[r].apply(n, Array.prototype.slice.call(arguments, 0, i - 1))
    }
  }
  var dc = Ze(On("slice", function (e, i, n) {
      return Array.prototype.slice.call(n, e, i)
    })),
    pc = dc,
    fc = X(On("tail", pc(1, 1 / 0))),
    mc = fc;

  function Vt() {
    if (arguments.length === 0) throw new Error("pipe requires at least one argument");
    return xe(arguments[0].length, kn(uc, arguments[0], mc(arguments)))
  }
  var gc = X(function (e) {
      return tr(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse()
    }),
    yc = gc;

  function vc(r) {
    return r
  }
  var _c = X(vc),
    Ai = _c;

  function Rn(r) {
    for (var e = [], i; !(i = r.next()).done;) e.push(i.value);
    return e
  }

  function Bn(r, e, i) {
    for (var n = 0, s = i.length; n < s;) {
      if (r(e, i[n])) return !0;
      n += 1
    }
    return !1
  }

  function wc(r) {
    var e = String(r).match(/^function (\w*)/);
    return e == null ? "" : e[1]
  }

  function Cc(r, e) {
    return r === e ? r !== 0 || 1 / r == 1 / e : r !== r && e !== e
  }
  var or = typeof Object.is == "function" ? Object.is : Cc;

  function Ln(r, e, i, n) {
    var s = Rn(r),
      o = Rn(e);

    function a(c, h) {
      return ar(c, h, i.slice(), n.slice())
    }
    return !Bn(function (c, h) {
      return !Bn(a, h, c)
    }, o, s)
  }

  function ar(r, e, i, n) {
    if (or(r, e)) return !0;
    var s = sr(r);
    if (s !== sr(e) || r == null || e == null) return !1;
    if (typeof r["fantasy-land/equals"] == "function" || typeof e["fantasy-land/equals"] == "function") return typeof r["fantasy-land/equals"] == "function" && r["fantasy-land/equals"](e) && typeof e["fantasy-land/equals"] == "function" && e["fantasy-land/equals"](r);
    if (typeof r.equals == "function" || typeof e.equals == "function") return typeof r.equals == "function" && r.equals(e) && typeof e.equals == "function" && e.equals(r);
    switch (s) {
      case "Arguments":
      case "Array":
      case "Object":
        if (typeof r.constructor == "function" && wc(r.constructor) === "Promise") return r === e;
        break;
      case "Boolean":
      case "Number":
      case "String":
        if (!(typeof r == typeof e && or(r.valueOf(), e.valueOf()))) return !1;
        break;
      case "Date":
        if (!or(r.valueOf(), e.valueOf())) return !1;
        break;
      case "Error":
        return r.name === e.name && r.message === e.message;
      case "RegExp":
        if (!(r.source === e.source && r.global === e.global && r.ignoreCase === e.ignoreCase && r.multiline === e.multiline && r.sticky === e.sticky && r.unicode === e.unicode)) return !1;
        break
    }
    for (var o = i.length - 1; o >= 0;) {
      if (i[o] === r) return n[o] === e;
      o -= 1
    }
    switch (s) {
      case "Map":
        return r.size !== e.size ? !1 : Ln(r.entries(), e.entries(), i.concat([r]), n.concat([e]));
      case "Set":
        return r.size !== e.size ? !1 : Ln(r.values(), e.values(), i.concat([r]), n.concat([e]));
      case "Arguments":
      case "Array":
      case "Object":
      case "Boolean":
      case "Number":
      case "String":
      case "Date":
      case "Error":
      case "RegExp":
      case "Int8Array":
      case "Uint8Array":
      case "Uint8ClampedArray":
      case "Int16Array":
      case "Uint16Array":
      case "Int32Array":
      case "Uint32Array":
      case "Float32Array":
      case "Float64Array":
      case "ArrayBuffer":
        break;
      default:
        return !1
    }
    var a = bt(r);
    if (a.length !== bt(e).length) return !1;
    var c = i.concat([r]),
      h = n.concat([e]);
    for (o = a.length - 1; o >= 0;) {
      var u = a[o];
      if (!(je(u, e) && ar(e[u], r[u], c, h))) return !1;
      o -= 1
    }
    return !0
  }
  var xc = J(function (e, i) {
      return ar(e, i, [], [])
    }),
    Gn = xc;

  function bc(r, e, i) {
    var n, s;
    if (typeof r.indexOf == "function") switch (typeof e) {
      case "number":
        if (e === 0) {
          for (n = 1 / e; i < r.length;) {
            if (s = r[i], s === 0 && 1 / s === n) return i;
            i += 1
          }
          return -1
        } else if (e !== e) {
          for (; i < r.length;) {
            if (s = r[i], typeof s == "number" && s !== s) return i;
            i += 1
          }
          return -1
        }
        return r.indexOf(e, i);
      case "string":
      case "boolean":
      case "function":
      case "undefined":
        return r.indexOf(e, i);
      case "object":
        if (e === null) return r.indexOf(e, i)
    }
    for (; i < r.length;) {
      if (Gn(r[i], e)) return i;
      i += 1
    }
    return -1
  }

  function Ac(r, e) {
    return bc(e, r, 0) >= 0
  }

  function lr(r) {
    var e = r.replace(/\\/g, "\\\\").replace(/[\b]/g, "\\b").replace(/\f/g, "\\f").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\v/g, "\\v").replace(/\0/g, "\\0");
    return '"' + e.replace(/"/g, '\\"') + '"'
  }
  var Wt = function (e) {
      return (e < 10 ? "0" : "") + e
    },
    Pc = typeof Date.prototype.toISOString == "function" ? function (e) {
      return e.toISOString()
    } : function (e) {
      return e.getUTCFullYear() + "-" + Wt(e.getUTCMonth() + 1) + "-" + Wt(e.getUTCDate()) + "T" + Wt(e.getUTCHours()) + ":" + Wt(e.getUTCMinutes()) + ":" + Wt(e.getUTCSeconds()) + "." + (e.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z"
    },
    Sc = Pc;

  function Tc(r) {
    return function () {
      return !r.apply(this, arguments)
    }
  }

  function Mc(r, e) {
    for (var i = 0, n = e.length, s = []; i < n;) r(e[i]) && (s[s.length] = e[i]), i += 1;
    return s
  }

  function cr(r) {
    return Object.prototype.toString.call(r) === "[object Object]"
  }
  var Ec = function () {
      function r(e, i) {
        this.xf = i, this.f = e
      }
      return r.prototype["@@transducer/init"] = xt.init, r.prototype["@@transducer/result"] = xt.result, r.prototype["@@transducer/step"] = function (e, i) {
        return this.f(i) ? this.xf["@@transducer/step"](e, i) : e
      }, r
    }(),
    Dc = J(function (e, i) {
      return new Ec(e, i)
    }),
    kc = Dc,
    zc = J(xi(["filter"], kc, function (r, e) {
      return cr(e) ? ir(function (i, n) {
        return r(e[n]) && (i[n] = e[n]), i
      }, {}, bt(e)) : Mc(r, e)
    })),
    Ic = zc,
    Oc = J(function (e, i) {
      return Ic(Tc(e), i)
    }),
    Rc = Oc;

  function Fn(r, e) {
    var i = function (a) {
        var c = e.concat([r]);
        return Ac(a, c) ? "<Circular>" : Fn(a, c)
      },
      n = function (o, a) {
        return bi(function (c) {
          return lr(c) + ": " + i(o[c])
        }, a.slice().sort())
      };
    switch (Object.prototype.toString.call(r)) {
      case "[object Arguments]":
        return "(function() { return arguments; }(" + bi(i, r).join(", ") + "))";
      case "[object Array]":
        return "[" + bi(i, r).concat(n(r, Rc(function (o) {
          return /^\d+$/.test(o)
        }, bt(r)))).join(", ") + "]";
      case "[object Boolean]":
        return typeof r == "object" ? "new Boolean(" + i(r.valueOf()) + ")" : r.toString();
      case "[object Date]":
        return "new Date(" + (isNaN(r.valueOf()) ? i(NaN) : lr(Sc(r))) + ")";
      case "[object Null]":
        return "null";
      case "[object Number]":
        return typeof r == "object" ? "new Number(" + i(r.valueOf()) + ")" : 1 / r == -1 / 0 ? "-0" : r.toString(10);
      case "[object String]":
        return typeof r == "object" ? "new String(" + i(r.valueOf()) + ")" : lr(r);
      case "[object Undefined]":
        return "undefined";
      default:
        if (typeof r.toString == "function") {
          var s = r.toString();
          if (s !== "[object Object]") return s
        }
        return "{" + n(r, bt(r)).join(", ") + "}"
    }
  }
  var Bc = X(function (e) {
      return Fn(e, [])
    }),
    Lc = Bc,
    Gc = X(function (e) {
      return Ut(e.length, function (i, n) {
        var s = Array.prototype.slice.call(arguments, 0);
        return s[0] = n, s[1] = i, e.apply(this, s)
      })
    }),
    Hn = Gc;

  function Fc(r) {
    if (r == null) throw new TypeError("Cannot convert undefined or null to object");
    for (var e = Object(r), i = 1, n = arguments.length; i < n;) {
      var s = arguments[i];
      if (s != null)
        for (var o in s) je(o, s) && (e[o] = s[o]);
      i += 1
    }
    return e
  }
  var Nn = typeof Object.assign == "function" ? Object.assign : Fc,
    Hc = J(function (e, i) {
      var n = {};
      return n[e] = i, n
    }),
    Nc = Hc,
    Uc = J(function (e, i) {
      return Ut(e + 1, function () {
        var n = arguments[e];
        if (n != null && ec(n[i])) return n[i].apply(n, Array.prototype.slice.call(arguments, 0, e));
        throw new TypeError(Lc(n) + ' does not have a method named "' + i + '"')
      })
    }),
    Vc = Uc,
    Wc = J(function (e, i) {
      return i != null && i.constructor === e || i instanceof e
    }),
    At = Wc,
    jc = J(function (e, i) {
      return function (n) {
        return function (s) {
          return Bl(function (o) {
            return i(o, s)
          }, n(e(s)))
        }
      }
    }),
    qc = jc,
    Qc = X(function (e) {
      return qc(Dn(e), Zl(e))
    }),
    Yc = Qc,
    Xc = J(function (e, i) {
      return Nn({}, e, i)
    }),
    Kc = Xc,
    Jc = X(function (e) {
      return Nn.apply(null, [{}].concat(e))
    }),
    $c = Jc,
    Zc = Ze(function (e, i, n) {
      var s = {},
        o;
      for (o in i) je(o, i) && (s[o] = je(o, n) ? e(o, i[o], n[o]) : i[o]);
      for (o in n) je(o, n) && !je(o, s) && (s[o] = n[o]);
      return s
    }),
    Un = Zc,
    eh = Ze(function r(e, i, n) {
      return Un(function (s, o, a) {
        return cr(o) && cr(a) ? r(e, o, a) : e(s, o, a)
      }, i, n)
    }),
    th = eh,
    ih = J(function (e, i) {
      return th(function (n, s, o) {
        return o
      }, e, i)
    }),
    rh = ih,
    Vn = function (r) {
      return {
        value: r,
        map: function (e) {
          return Vn(e(r))
        }
      }
    },
    nh = Ze(function (e, i, n) {
      return e(function (s) {
        return Vn(i(s))
      })(n).value
    }),
    sh = nh,
    oh = J(function (e, i) {
      return Ut(i.length, function () {
        for (var n = [], s = 0; s < i.length;) n.push(i[s].call(this, arguments[s])), s += 1;
        return e.apply(this, n.concat(Array.prototype.slice.call(arguments, i.length)))
      })
    }),
    hr = oh,
    ah = Ze(function (e, i, n) {
      return sh(e, Wl(i), n)
    }),
    lh = ah,
    ch = Vc(1, "split"),
    ur = ch;
  const l = window.Cesium,
    et = {
      tianditu: "",
      gaode: "",
      badiu: ""
    },
    hh = function (r) {
      const e = new l.Cartesian3(r.x, r.y, r.z),
        i = l.Cartographic.fromCartesian(e),
        n = l.Math.toDegrees(i.latitude),
        s = l.Math.toDegrees(i.longitude),
        o = i.height;
      return {
        x: s,
        y: n,
        z: o
      }
    },
    uh = function (r) {
      return r && (r instanceof l.Cartographic ? l.Ellipsoid.WGS84.cartographicToCartesian(r) : Ie(r) ? l.Cartesian3.fromDegrees(...r) : Re(r) ? l.Cartesian3.fromDegrees(...r.split(",")) : Us([r.lng, r.lat]) ? l.Cartesian3.fromDegrees(r.lng, r.lat, r.alt || r.height) : Us([r.longitude, r.latitude]) ? l.Cartesian3.fromDegrees(r.longitude, r.latitude, r.alt || r.height) : r)
    };

  function dh(r, e, i) {
    i = i || {}, i.cartesian = i.cartesian || l.Cartographic.fromCartesian(e);
    let n = i.cartesian;
    if (i.asyn) r.clampToHeightMostDetailed([e]).then(s => {
      let o = s[0];
      if (l.defined(o)) {
        let a = l.Cartographic.fromCartesian(o),
          c = a.height;
        if (l.defined(c) && c > -1e3) {
          i.calback && i.calback(c, a);
          return
        }
      }
      Wn(r, e, i)
    });
    else {
      let s = r.sampleHeight(n);
      if (l.defined(s) && s > -1e3) return i.calback && i.calback(s, n), s
    }
    return 0
  }

  function Wn(r, e, i) {
    i = i || {};
    let n = i.cartesian || l.Cartographic.fromCartesian(e);
    if (!ph(r)) return i.calback && i.calback(n.height, n), n.height;
    if (i.asyn) l.when(l.sampleTerrainMostDetailed(r.terrainProvider, [n]), o => {
      let a = o[0],
        c;
      l.defined(a) && l.defined(a.height) ? c = a.height : c = r.globe.getHeight(n), i.calback && i.calback(c, n)
    });
    else {
      let o = r.globe.getHeight(n);
      if (l.defined(o) && o > -1e3) return i.calback && i.calback(o, n), o
    }
    return 0
  }

  function ph(r) {
    return !(r.terrainProvider == new l.EllipsoidTerrainProvider({
      ellipsoid: l.Ellipsoid.WGS84
    }) || r.terrainProvider instanceof l.EllipsoidTerrainProvider)
  }

  function fh(r, e) {
    if (e = Number(e) || 0, isNaN(e) || e == 0) return r;
    if (r instanceof Array) {
      let n = [];
      for (let s = 0, o = r.length; s < o; s++) {
        let a = l.Cartographic.fromCartesian(r[s]),
          c = l.Cartesian3.fromRadians(a.longitude, a.latitude, a.height + e);
        n.push(c)
      }
      return n
    }
    let i = l.Cartographic.fromCartesian(r);
    return l.Cartesian3.fromRadians(i.longitude, i.latitude, i.height + e)
  }

  function mh(r, e) {
    if (e = Number(e) || 0, isNaN(e)) return r;
    if (r instanceof Array) {
      let n = [];
      for (let s = 0, o = r.length; s < o; s++) {
        let a = l.Cartographic.fromCartesian(r[s]),
          c = l.Cartesian3.fromRadians(a.longitude, a.latitude, e);
        n.push(c)
      }
      return n
    }
    let i = l.Cartographic.fromCartesian(r);
    return l.Cartesian3.fromRadians(i.longitude, i.latitude, e)
  }

  function jn(r, e, i, n) {
    if (!l.defined(e) || !l.defined(r)) return new l.HeadingPitchRoll;
    let s = l.Matrix4.fromRotationTranslation(l.Matrix3.fromQuaternion(e, new l.Matrix3), r, new l.Matrix4);
    return gh(s, i, n)
  }

  function gh(r, e, i, n) {
    return l.Transforms.fixedFrameToHeadingPitchRoll(r, e, i, n)
  }

  function yh(r, e = {}, i) {
    var g, y;
    const n = e.roll || 0,
      s = e.pitch || 0,
      o = e.heading || 0,
      a = new l.HeadingPitchRoll(Math.PI * (o / 180), Math.PI * (s / 180), Math.PI * (n / 180)),
      c = l.Matrix3.fromHeadingPitchRoll(a, new l.Matrix3),
      h = ((g = i.root) == null ? void 0 : g.transform) ? l.Matrix4.unpack((y = i.root) == null ? void 0 : y.transform) : l.Matrix4.IDENTITY,
      u = !h.equals(l.Matrix4.IDENTITY),
      d = l.Matrix4.multiplyByPoint(l.Matrix4.inverse(l.Matrix4.multiply(i.modelMatrix, h, new l.Matrix4), new l.Matrix4), i.boundingSphere.center, new l.Cartesian3),
      p = l.Transforms.eastNorthUpToFixedFrame(d),
      f = l.Transforms.eastNorthUpToFixedFrame(r);
    let m = l.Matrix4.multiply(f, l.Matrix4.inverse(l.Matrix4.multiplyByMatrix3(p, c, new l.Matrix4), new l.Matrix4), new l.Matrix4);
    if (u) {
      const x = l.Matrix4.multiplyByTranslation(l.Transforms.eastNorthUpToFixedFrame(r), new l.Cartesian3, new l.Matrix4);
      return {
        modelMatrix: l.Matrix4.multiply(x, l.Matrix4.inverse(l.Matrix4.multiplyByMatrix3(h, c, new l.Matrix4), new l.Matrix4), new l.Matrix4)
      }
    }
    return {
      modelMatrix: m
    }
  }

  function qn(r) {
    let e = r.position;
    if (!e) return null;
    if (!(r.semiAxis || r.semiMajorAxis || r.semiMinorAxis)) return;
    let i = l.defaultValue(r.count, 1),
      n = l.defaultValue(r.semiMajorAxis, r.semiAxis || r.radius),
      s = l.defaultValue(r.semiMinorAxis, r.semiAxis || r.radius),
      o = l.defaultValue(r.rotation, -90),
      c = l.EllipseGeometryLibrary.computeEllipsePositions({
        center: e,
        semiMajorAxis: n,
        semiMinorAxis: s,
        rotation: l.Math.toRadians(o),
        granularity: Math.PI / (16 * i)
      }, !0, !0).outerPositions,
      h = [];
    for (let u = 0, d = c.length; u < d; u += 3) {
      let p = new l.Cartesian3(c[u], c[u + 1], c[u + 2]);
      h.push(p)
    }
    return h
  }
  const vh = r => {
    const e = l.Cartesian3,
      i = l.Matrix3,
      n = new e,
      s = new e,
      o = new e,
      a = [new e, new e, new e, new e, new e, new e, new e, new e],
      c = r.center,
      h = r.halfAxes,
      u = i.getColumn(h, 0, n),
      d = i.getColumn(h, 1, s),
      p = i.getColumn(h, 2, o);
    return e.clone(c, a[0]), e.subtract(a[0], u, a[0]), e.subtract(a[0], d, a[0]), e.subtract(a[0], p, a[0]), e.clone(c, a[1]), e.subtract(a[1], u, a[1]), e.subtract(a[1], d, a[1]), e.add(a[1], p, a[1]), e.clone(c, a[2]), e.subtract(a[2], u, a[2]), e.add(a[2], d, a[2]), e.subtract(a[2], p, a[2]), e.clone(c, a[3]), e.subtract(a[3], u, a[3]), e.add(a[3], d, a[3]), e.add(a[3], p, a[3]), e.clone(c, a[4]), e.add(a[4], u, a[4]), e.subtract(a[4], d, a[4]), e.subtract(a[4], p, a[4]), e.clone(c, a[5]), e.add(a[5], u, a[5]), e.subtract(a[5], d, a[5]), e.add(a[5], p, a[5]), e.clone(c, a[6]), e.add(a[6], u, a[6]), e.add(a[6], d, a[6]), e.subtract(a[6], p, a[6]), e.clone(c, a[7]), e.add(a[7], u, a[7]), e.add(a[7], d, a[7]), e.add(a[7], p, a[7]), a
  };

  function _h(r, e, i) {
    let n = l.Cartographic.fromCartesian(r);
    n.height = n.height - 10;
    let s = l.Cartographic.toCartesian(n),
      o = l.Cartesian3.normalize(l.Cartesian3.subtract(s, r, new l.Cartesian3), new l.Cartesian3),
      a = l.Quaternion.fromAxisAngle(o, l.Math.toRadians(i)),
      c = l.Matrix3.fromQuaternion(a),
      h = l.Matrix4.fromRotationTranslation(c),
      u = l.Cartesian3.subtract(e, r, new l.Cartesian3),
      d = l.Matrix4.multiplyByPoint(h, u, new l.Cartesian3);
    return l.Cartesian3.add(d, r, new l.Cartesian3)
  }

  function dr(r, e, i) {
    i === void 0 && (i = {});
    var n = {
      type: "Feature"
    };
    return (i.id === 0 || i.id) && (n.id = i.id), i.bbox && (n.bbox = i.bbox), n.properties = e || {}, n.geometry = r, n
  }

  function Pi(r, e, i) {
    if (i === void 0 && (i = {}), !r) throw new Error("coordinates is required");
    if (!Array.isArray(r)) throw new Error("coordinates must be an Array");
    if (r.length < 2) throw new Error("coordinates must be at least 2 numbers long");
    if (!Qn(r[0]) || !Qn(r[1])) throw new Error("coordinates must contain numbers");
    var n = {
      type: "Point",
      coordinates: r
    };
    return dr(n, e, i)
  }

  function pr(r, e, i) {
    i === void 0 && (i = {});
    for (var n = 0, s = r; n < s.length; n++) {
      var o = s[n];
      if (o.length < 4) throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
      for (var a = 0; a < o[o.length - 1].length; a++)
        if (o[o.length - 1][a] !== o[0][a]) throw new Error("First and last Position are not equivalent.")
    }
    var c = {
      type: "Polygon",
      coordinates: r
    };
    return dr(c, e, i)
  }

  function fr(r, e, i) {
    if (i === void 0 && (i = {}), r.length < 2) throw new Error("coordinates must be an array of two or more positions");
    var n = {
      type: "LineString",
      coordinates: r
    };
    return dr(n, e, i)
  }

  function wh(r, e) {
    e === void 0 && (e = {});
    var i = {
      type: "FeatureCollection"
    };
    return e.id && (i.id = e.id), e.bbox && (i.bbox = e.bbox), i.features = r, i
  }

  function Ch(r) {
    var e = r % (2 * Math.PI);
    return e * 180 / Math.PI
  }

  function mr(r) {
    var e = r % 360;
    return e * Math.PI / 180
  }

  function Qn(r) {
    return !isNaN(r) && r !== null && !Array.isArray(r)
  }

  function Yn(r, e, i) {
    if (r !== null)
      for (var n, s, o, a, c, h, u, d = 0, p = 0, f, m = r.type, g = m === "FeatureCollection", y = m === "Feature", x = g ? r.features.length : 1, A = 0; A < x; A++) {
        u = g ? r.features[A].geometry : y ? r.geometry : r, f = u ? u.type === "GeometryCollection" : !1, c = f ? u.geometries.length : 1;
        for (var _ = 0; _ < c; _++) {
          var v = 0,
            b = 0;
          if (a = f ? u.geometries[_] : u, a !== null) {
            h = a.coordinates;
            var C = a.type;
            switch (d = i && (C === "Polygon" || C === "MultiPolygon") ? 1 : 0, C) {
              case null:
                break;
              case "Point":
                if (e(h, p, A, v, b) === !1) return !1;
                p++, v++;
                break;
              case "LineString":
              case "MultiPoint":
                for (n = 0; n < h.length; n++) {
                  if (e(h[n], p, A, v, b) === !1) return !1;
                  p++, C === "MultiPoint" && v++
                }
                C === "LineString" && v++;
                break;
              case "Polygon":
              case "MultiLineString":
                for (n = 0; n < h.length; n++) {
                  for (s = 0; s < h[n].length - d; s++) {
                    if (e(h[n][s], p, A, v, b) === !1) return !1;
                    p++
                  }
                  C === "MultiLineString" && v++, C === "Polygon" && b++
                }
                C === "Polygon" && v++;
                break;
              case "MultiPolygon":
                for (n = 0; n < h.length; n++) {
                  for (b = 0, s = 0; s < h[n].length; s++) {
                    for (o = 0; o < h[n][s].length - d; o++) {
                      if (e(h[n][s][o], p, A, v, b) === !1) return !1;
                      p++
                    }
                    b++
                  }
                  v++
                }
                break;
              case "GeometryCollection":
                for (n = 0; n < a.geometries.length; n++)
                  if (Yn(a.geometries[n], e, i) === !1) return !1;
                break;
              default:
                throw new Error("Unknown Geometry Type")
            }
          }
        }
      }
  }

  function xh(r, e) {
    var i, n, s, o, a, c, h, u, d, p, f = 0,
      m = r.type === "FeatureCollection",
      g = r.type === "Feature",
      y = m ? r.features.length : 1;
    for (i = 0; i < y; i++) {
      for (c = m ? r.features[i].geometry : g ? r.geometry : r, u = m ? r.features[i].properties : g ? r.properties : {}, d = m ? r.features[i].bbox : g ? r.bbox : void 0, p = m ? r.features[i].id : g ? r.id : void 0, h = c ? c.type === "GeometryCollection" : !1, a = h ? c.geometries.length : 1, s = 0; s < a; s++) {
        if (o = h ? c.geometries[s] : c, o === null) {
          if (e(null, f, u, d, p) === !1) return !1;
          continue
        }
        switch (o.type) {
          case "Point":
          case "LineString":
          case "MultiPoint":
          case "Polygon":
          case "MultiLineString":
          case "MultiPolygon": {
            if (e(o, f, u, d, p) === !1) return !1;
            break
          }
          case "GeometryCollection": {
            for (n = 0; n < o.geometries.length; n++)
              if (e(o.geometries[n], f, u, d, p) === !1) return !1;
            break
          }
          default:
            throw new Error("Unknown Geometry Type")
        }
      }
      f++
    }
  }

  function bh(r, e, i) {
    var n = i;
    return xh(r, function (s, o, a, c, h) {
      o === 0 && i === void 0 ? n = s : n = e(n, s, o, a, c, h)
    }), n
  }

  function Pt(r) {
    if (!r) throw new Error("coord is required");
    if (!Array.isArray(r)) {
      if (r.type === "Feature" && r.geometry !== null && r.geometry.type === "Point") return r.geometry.coordinates;
      if (r.type === "Point") return r.coordinates
    }
    if (Array.isArray(r) && r.length >= 2 && !Array.isArray(r[0]) && !Array.isArray(r[1])) return r;
    throw new Error("coord must be GeoJSON Point or an Array of numbers")
  }

  function Ah(r) {
    if (Array.isArray(r)) return r;
    if (r.type === "Feature") {
      if (r.geometry !== null) return r.geometry.coordinates
    } else if (r.coordinates) return r.coordinates;
    throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")
  }

  function Xn(r) {
    return r.type === "Feature" ? r.geometry : r
  }
  var ve = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};

  function Ph(r) {
    if (r.__esModule) return r;
    var e = Object.defineProperty({}, "__esModule", {
      value: !0
    });
    return Object.keys(r).forEach(function (i) {
      var n = Object.getOwnPropertyDescriptor(r, i);
      Object.defineProperty(e, i, n.get ? n : {
        enumerable: !0,
        get: function () {
          return r[i]
        }
      })
    }), e
  }

  function Sh(r) {
    throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')
  }

  function Th(r, e, i) {
    if (i === void 0 && (i = {}), !r) throw new Error("point is required");
    if (!e) throw new Error("polygon is required");
    var n = Pt(r),
      s = Xn(e),
      o = s.type,
      a = e.bbox,
      c = s.coordinates;
    if (a && Mh(n, a) === !1) return !1;
    o === "Polygon" && (c = [c]);
    for (var h = !1, u = 0; u < c.length && !h; u++)
      if (Kn(n, c[u][0], i.ignoreBoundary)) {
        for (var d = !1, p = 1; p < c[u].length && !d;) Kn(n, c[u][p], !i.ignoreBoundary) && (d = !0), p++;
        d || (h = !0)
      } return h
  }

  function Kn(r, e, i) {
    var n = !1;
    e[0][0] === e[e.length - 1][0] && e[0][1] === e[e.length - 1][1] && (e = e.slice(0, e.length - 1));
    for (var s = 0, o = e.length - 1; s < e.length; o = s++) {
      var a = e[s][0],
        c = e[s][1],
        h = e[o][0],
        u = e[o][1],
        d = r[1] * (a - h) + c * (h - r[0]) + u * (r[0] - a) == 0 && (a - r[0]) * (h - r[0]) <= 0 && (c - r[1]) * (u - r[1]) <= 0;
      if (d) return !i;
      var p = c > r[1] != u > r[1] && r[0] < (h - a) * (r[1] - c) / (u - c) + a;
      p && (n = !n)
    }
    return n
  }

  function Mh(r, e) {
    return e[0] <= r[0] && e[1] <= r[1] && e[2] >= r[0] && e[3] >= r[1]
  }
  var Eh = function () {
      function r(e) {
        this.points = e.points || [], this.duration = e.duration || 1e4, this.sharpness = e.sharpness || .85, this.centers = [], this.controls = [], this.stepLength = e.stepLength || 60, this.length = this.points.length, this.delay = 0;
        for (var i = 0; i < this.length; i++) this.points[i].z = this.points[i].z || 0;
        for (var i = 0; i < this.length - 1; i++) {
          var n = this.points[i],
            s = this.points[i + 1];
          this.centers.push({
            x: (n.x + s.x) / 2,
            y: (n.y + s.y) / 2,
            z: (n.z + s.z) / 2
          })
        }
        this.controls.push([this.points[0], this.points[0]]);
        for (var i = 0; i < this.centers.length - 1; i++) {
          var o = this.points[i + 1].x - (this.centers[i].x + this.centers[i + 1].x) / 2,
            a = this.points[i + 1].y - (this.centers[i].y + this.centers[i + 1].y) / 2,
            c = this.points[i + 1].z - (this.centers[i].y + this.centers[i + 1].z) / 2;
          this.controls.push([{
            x: (1 - this.sharpness) * this.points[i + 1].x + this.sharpness * (this.centers[i].x + o),
            y: (1 - this.sharpness) * this.points[i + 1].y + this.sharpness * (this.centers[i].y + a),
            z: (1 - this.sharpness) * this.points[i + 1].z + this.sharpness * (this.centers[i].z + c)
          }, {
            x: (1 - this.sharpness) * this.points[i + 1].x + this.sharpness * (this.centers[i + 1].x + o),
            y: (1 - this.sharpness) * this.points[i + 1].y + this.sharpness * (this.centers[i + 1].y + a),
            z: (1 - this.sharpness) * this.points[i + 1].z + this.sharpness * (this.centers[i + 1].z + c)
          }])
        }
        return this.controls.push([this.points[this.length - 1], this.points[this.length - 1]]), this.steps = this.cacheSteps(this.stepLength), this
      }
      return r.prototype.cacheSteps = function (e) {
        var i = [],
          n = this.pos(0);
        i.push(0);
        for (var s = 0; s < this.duration; s += 10) {
          var o = this.pos(s),
            a = Math.sqrt((o.x - n.x) * (o.x - n.x) + (o.y - n.y) * (o.y - n.y) + (o.z - n.z) * (o.z - n.z));
          a > e && (i.push(s), n = o)
        }
        return i
      }, r.prototype.vector = function (e) {
        var i = this.pos(e + 10),
          n = this.pos(e - 10);
        return {
          angle: 180 * Math.atan2(i.y - n.y, i.x - n.x) / 3.14,
          speed: Math.sqrt((n.x - i.x) * (n.x - i.x) + (n.y - i.y) * (n.y - i.y) + (n.z - i.z) * (n.z - i.z))
        }
      }, r.prototype.pos = function (e) {
        var i = e - this.delay;
        i < 0 && (i = 0), i > this.duration && (i = this.duration - 1);
        var n = i / this.duration;
        if (n >= 1) return this.points[this.length - 1];
        var s = Math.floor((this.points.length - 1) * n),
          o = (this.length - 1) * n - s;
        return kh(o, this.points[s], this.controls[s][1], this.controls[s + 1][0], this.points[s + 1])
      }, r
    }(),
    Dh = Eh;

  function kh(r, e, i, n, s) {
    var o = zh(r),
      a = {
        x: s.x * o[0] + n.x * o[1] + i.x * o[2] + e.x * o[3],
        y: s.y * o[0] + n.y * o[1] + i.y * o[2] + e.y * o[3],
        z: s.z * o[0] + n.z * o[1] + i.z * o[2] + e.z * o[3]
      };
    return a
  }

  function zh(r) {
    var e = r * r,
      i = e * r;
    return [i, 3 * e * (1 - r), 3 * r * (1 - r) * (1 - r), (1 - r) * (1 - r) * (1 - r)]
  }

  function Ih(r, e) {
    e === void 0 && (e = {});
    for (var i = e.resolution || 1e4, n = e.sharpness || .85, s = [], o = Xn(r).coordinates.map(function (u) {
        return {
          x: u[0],
          y: u[1]
        }
      }), a = new Dh({
        duration: i,
        points: o,
        sharpness: n
      }), c = function (u) {
        var d = a.pos(u);
        Math.floor(u / 100) % 2 == 0 && s.push([d.x, d.y])
      }, h = 0; h < a.duration; h += 10) c(h);
    return c(a.duration), fr(s, e.properties)
  }

  function Oh(r, e) {
    e === void 0 && (e = {});
    var i = 0,
      n = 0,
      s = 0;
    return Yn(r, function (o) {
      i += o[0], n += o[1], s++
    }, !0), Pi([i / s, n / s], e.properties)
  }
  var Jn = 6378137;

  function Rh(r) {
    return bh(r, function (e, i) {
      return e + Bh(i)
    }, 0)
  }

  function Bh(r) {
    var e = 0,
      i;
    switch (r.type) {
      case "Polygon":
        return $n(r.coordinates);
      case "MultiPolygon":
        for (i = 0; i < r.coordinates.length; i++) e += $n(r.coordinates[i]);
        return e;
      case "Point":
      case "MultiPoint":
      case "LineString":
      case "MultiLineString":
        return 0
    }
    return 0
  }

  function $n(r) {
    var e = 0;
    if (r && r.length > 0) {
      e += Math.abs(Zn(r[0]));
      for (var i = 1; i < r.length; i++) e -= Math.abs(Zn(r[i]))
    }
    return e
  }

  function Zn(r) {
    var e, i, n, s, o, a, c, h = 0,
      u = r.length;
    if (u > 2) {
      for (c = 0; c < u; c++) c === u - 2 ? (s = u - 2, o = u - 1, a = 0) : c === u - 1 ? (s = u - 1, o = 0, a = 1) : (s = c, o = c + 1, a = c + 2), e = r[s], i = r[o], n = r[a], h += (gr(n[0]) - gr(e[0])) * Math.sin(gr(i[1]));
      h = h * Jn * Jn / 2
    }
    return h
  }

  function gr(r) {
    return r * Math.PI / 180
  }

  function Lh(r, e, i) {
    i === void 0 && (i = {});
    var n;
    i.final ? n = es(Pt(e), Pt(r)) : n = es(Pt(r), Pt(e));
    var s = n > 180 ? -(360 - n) : n;
    return s
  }

  function es(r, e) {
    var i = mr(r[1]),
      n = mr(e[1]),
      s = mr(e[0] - r[0]);
    s > Math.PI && (s -= 2 * Math.PI), s < -Math.PI && (s += 2 * Math.PI);
    var o = Math.log(Math.tan(n / 2 + Math.PI / 4) / Math.tan(i / 2 + Math.PI / 4)),
      a = Math.atan2(s, o);
    return (Ch(a) + 360) % 360
  }
  const ts = (r, e) => {
      const i = Pi(r),
        n = rs(e);
      return Th(i, n)
    },
    Gh = Pi,
    Fh = fr,
    is = (r, e) => Hr(r[0], r[r.length - 1]) ? pr([r]) : pr([
      [...r, r[0]]
    ], e),
    Hh = function (r) {
      const e = rs(r);
      return Rh(e)
    };

  function rs(r) {
    const e = Hr(r[0], r[r.length - 1]);
    return pr([r.concat(e ? [] : [r[0]])])
  }
  const Nh = function (r, e) {
      const i = l.Cartographic.fromCartesian(r),
        n = l.Cartographic.fromCartesian(e);
      let s = {
          type: "Feature",
          geometry: {
            type: "Point",
            coordinates: [l.Math.toDegrees(i.longitude), l.Math.toDegrees(i.latitude), i.height]
          }
        },
        o = {
          type: "Feature",
          geometry: {
            type: "Point",
            coordinates: [l.Math.toDegrees(n.longitude), l.Math.toDegrees(n.latitude), n.height]
          }
        };
      return Math.round(Lh(s, o))
    },
    yr = function (r) {
      const e = r.map(n => new R(n)),
        i = Oh(wh(e.map(n => Pi(n.toLatLngArray()))));
      return Pt(i).concat(e.reduce((n, s) => n + s.height, 0) / e.length)
    };
  window.getCenter = yr;
  const G = {
      Billboard: "billboard",
      Box: "box",
      Corridor: "corridor",
      Cylinder: "cylinder",
      DivPoint: "divPoint",
      Ellipse: "ellipse",
      Circle: "circle",
      GeoJson: "geoJson",
      Label: "label",
      Model: "model",
      Path: "path",
      Plane: "plane",
      Point: "point",
      Polyline: "polyline",
      Polygon: "polygon",
      PolylineVolume: "polylineVolume",
      Rectangle: "rectangle",
      RoamLine: "roamLine",
      Tileset: "tileset",
      Wall: "wall",
      Compose: "compose",
      Heatmap: "heatmap",
      Group: "group",
      BillboardGroup: "billboardGroup",
      Animate: "animate",
      Tooltip: "tooltip",
      Czml: "czml",
      Kml: "kml",
      PolylinePrimitive: "polylinePrimitive",
      PositionGroup: "PositionGroup"
    },
    jt = {
      Floor: "floor",
      Navigation: "navigation",
      LocationBar: "locationBar",
      Overview: "overview"
    },
    le = {
      MaterialColor: "MaterialColor",
      Color: "Color",
      Checkerboard: "Checkerboard",
      CircleScan: "CircleScan",
      CircleWave: "CircleWave",
      Grid: "Grid",
      Image: "Image",
      Image2: "Image2",
      LineFlow: "LineFlow",
      PolylineArrow: "PolylineArrow",
      PolylineDash: "PolylineDash",
      PolylineGlow: "PolylineGlow",
      Water: "Water",
      PolylineOutline: "PolylineOutline",
      Stripe: "Stripe",
      ODLine: "ODLine",
      LineTrail: "LineTrail",
      LineTrailOnce: "LineTrailOnce",
      LineFlowColor: "LineFlowColor",
      LineFlicker: "LineFlicker",
      PolyGrass: "PolyGrass",
      PolylineArrowLine: "PolylineArrowLine"
    },
    K = {
      Click: "click",
      RClick: "rClick",
      DbClick: "dbClick",
      Mousemove: "mousemove",
      Mouseenter: "mouseenter",
      Mouseleave: "mouseleave",
      Mousedown: "mousedown",
      Mouseup: "mouseup",
      Middledown: "middledown",
      Middleup: "middleup",
      RightMousedown: "rightMousedown",
      RightMouseup: "rightMouseup",
      MiddleClick: "middleClick",
      Wheel: "wheel",
      PinchStart: "pinchStart",
      PinchEnd: "pinchEnd",
      PinchMove: "pinchMove",
      MorphComplete: "morphComplete",
      MorphStart: "morphStart",
      PostRender: "postRender",
      PreRender: "preRender",
      PostUpdate: "postUpdate",
      PreUpdate: "preUpdate",
      RenderError: "renderError",
      TerrainProviderChanged: "terrainProviderChanged",
      CameraChanged: "cameraChanged",
      CameraMoveEnd: "cameraMoveEnd",
      CameraMoveStart: "cameraMoveStart",
      ClockStop: "clockStop",
      ClockTick: "clockTick",
      DrawStart: "drawStart",
      DrawPoint: "drawPoint",
      DrawRemovePoint: "drawRemovePoint",
      DrawEnd: "drawEnd",
      DrawCancel: "drawCancel",
      EditStart: "editStart",
      EditAddPoint: "editAddPoint",
      EditPoint: "editPoint",
      EditHeight: "editHeight",
      EditRemovePoint: "editRemovePoint",
      EditEnd: "editEnd"
    },
    me = {
      INITIALIZED: "initialized",
      ADDED: "added",
      DESTROYED: "destroyed",
      REMOVED: "removed"
    },
    he = {
      Cloud: "cloud",
      Fog: "fog",
      Rain: "rain",
      Snow: "snow",
      Brightness: "brightness",
      Bloom: "bloom",
      DepthOfField: "depthOfField",
      Silhouette: "silhouette",
      Night: "night",
      BlackAndWhite: "blackAndWhite",
      VisualImpact: "visualImpact"
    };
  var Uh = Object.freeze({
    __proto__: null,
    [Symbol.toStringTag]: "Module",
    GraphicType: G,
    ControlType: jt,
    MaterialType: le,
    EventType: K,
    State: me,
    EffectType: he
  });
  class vr {
    constructor() {
      P(this, "events", {});
      P(this, "isDestroyed", !1);
      P(this, "forbidEvent", !1)
    }
    destroy() {
      this.isDestroyed || (this.isDestroyed = !0, this.fire("destroy"), this.events && (Object.values(this.events).forEach(e => {
        e.subscriptionMap.forEach(i => {
          i.unsubscribe()
        }), e.fireSubject.complete()
      }), this.events = null))
    }
    on(e, i) {
      const n = /\s|,/;
      if (n.test(e)) {
        const s = e.split(n).map(o => this.on(o, i));
        return () => {
          s.forEach(o => o())
        }
      }
      return this.events[e] || (this.events[e] = this._createObserver(e)), this.events[e].subscriptionMap.has(i) || this.events[e].subscriptionMap.set(i, this.events[e].observer.subscribe(s => {
        i(...s, e)
      })), () => {
        this.off(e, i)
      }
    }
    _createObserver() {}
    once(e, i) {
      const n = /\s|,/;
      if (n.test(e)) {
        let o = [];
        const a = (...c) => (o.forEach(h => h()), i(...c));
        return o = e.split(n).map(c => this.on(c, a)), () => {
          o.forEach(c => c())
        }
      }
      const s = (...o) => (this.off(e, s), i(...o));
      return this.on(e, s), () => {
        this.off(e, s)
      }
    }
    off(e, i) {
      const n = /\s|,/;
      if (n.test(e)) {
        e.split(n).forEach(s => {
          this.off(s, i)
        });
        return
      }
      this.events[e] && this.events[e].subscriptionMap.has(i) && (this.events[e].subscriptionMap.get(i).unsubscribe(), this.events[e].subscriptionMap.delete(i))
    }
    offAll(e) {
      const i = /\s|,/;
      if (i.test(e)) {
        e.split(i).forEach(n => {
          this.offAll(n)
        });
        return
      }
      if (this.events[e])
        for (const n of this.events[e].subscriptionMap.keys()) this.off(e, n)
    }
    fire(e, ...i) {
      if (this.forbidEvent) return;
      const n = /\s|,/;
      if (n.test(e)) {
        e.split(n).forEach(s => {
          this.fire(s, ...i)
        });
        return
      }
      this.events && this.events[e] && this.events[e].fireSubject.next(i)
    }
    hasEvent(e) {
      return !!this.events[e]
    }
  }
  var _r = function (r, e) {
    return _r = Object.setPrototypeOf || {
      __proto__: []
    }
    instanceof Array && function (i, n) {
      i.__proto__ = n
    } || function (i, n) {
      for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (i[s] = n[s])
    }, _r(r, e)
  };

  function St(r, e) {
    if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
    _r(r, e);

    function i() {
      this.constructor = r
    }
    r.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i)
  }

  function Vh(r, e, i, n) {
    function s(o) {
      return o instanceof i ? o : new i(function (a) {
        a(o)
      })
    }
    return new(i || (i = Promise))(function (o, a) {
      function c(d) {
        try {
          u(n.next(d))
        } catch (p) {
          a(p)
        }
      }

      function h(d) {
        try {
          u(n.throw(d))
        } catch (p) {
          a(p)
        }
      }

      function u(d) {
        d.done ? o(d.value) : s(d.value).then(c, h)
      }
      u((n = n.apply(r, e || [])).next())
    })
  }

  function ns(r, e) {
    var i = {
        label: 0,
        sent: function () {
          if (o[0] & 1) throw o[1];
          return o[1]
        },
        trys: [],
        ops: []
      },
      n, s, o, a;
    return a = {
      next: c(0),
      throw: c(1),
      return: c(2)
    }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
      return this
    }), a;

    function c(u) {
      return function (d) {
        return h([u, d])
      }
    }

    function h(u) {
      if (n) throw new TypeError("Generator is already executing.");
      for (; i;) try {
        if (n = 1, s && (o = u[0] & 2 ? s.return : u[0] ? s.throw || ((o = s.return) && o.call(s), 0) : s.next) && !(o = o.call(s, u[1])).done) return o;
        switch (s = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
          case 0:
          case 1:
            o = u;
            break;
          case 4:
            return i.label++, {
              value: u[1],
              done: !1
            };
          case 5:
            i.label++, s = u[1], u = [0];
            continue;
          case 7:
            u = i.ops.pop(), i.trys.pop();
            continue;
          default:
            if (o = i.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
              i = 0;
              continue
            }
            if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
              i.label = u[1];
              break
            }
            if (u[0] === 6 && i.label < o[1]) {
              i.label = o[1], o = u;
              break
            }
            if (o && i.label < o[2]) {
              i.label = o[2], i.ops.push(u);
              break
            }
            o[2] && i.ops.pop(), i.trys.pop();
            continue
        }
        u = e.call(r, i)
      } catch (d) {
        u = [6, d], s = 0
      } finally {
        n = o = 0
      }
      if (u[0] & 5) throw u[1];
      return {
        value: u[0] ? u[1] : void 0,
        done: !0
      }
    }
  }

  function Tt(r) {
    var e = typeof Symbol == "function" && Symbol.iterator,
      i = e && r[e],
      n = 0;
    if (i) return i.call(r);
    if (r && typeof r.length == "number") return {
      next: function () {
        return r && n >= r.length && (r = void 0), {
          value: r && r[n++],
          done: !r
        }
      }
    };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
  }

  function ke(r, e) {
    var i = typeof Symbol == "function" && r[Symbol.iterator];
    if (!i) return r;
    var n = i.call(r),
      s, o = [],
      a;
    try {
      for (;
        (e === void 0 || e-- > 0) && !(s = n.next()).done;) o.push(s.value)
    } catch (c) {
      a = {
        error: c
      }
    } finally {
      try {
        s && !s.done && (i = n.return) && i.call(n)
      } finally {
        if (a) throw a.error
      }
    }
    return o
  }

  function ze(r, e, i) {
    if (i || arguments.length === 2)
      for (var n = 0, s = e.length, o; n < s; n++)(o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
    return r.concat(o || Array.prototype.slice.call(e))
  }

  function Mt(r) {
    return this instanceof Mt ? (this.v = r, this) : new Mt(r)
  }

  function Wh(r, e, i) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var n = i.apply(r, e || []),
      s, o = [];
    return s = {}, a("next"), a("throw"), a("return"), s[Symbol.asyncIterator] = function () {
      return this
    }, s;

    function a(f) {
      n[f] && (s[f] = function (m) {
        return new Promise(function (g, y) {
          o.push([f, m, g, y]) > 1 || c(f, m)
        })
      })
    }

    function c(f, m) {
      try {
        h(n[f](m))
      } catch (g) {
        p(o[0][3], g)
      }
    }

    function h(f) {
      f.value instanceof Mt ? Promise.resolve(f.value.v).then(u, d) : p(o[0][2], f)
    }

    function u(f) {
      c("next", f)
    }

    function d(f) {
      c("throw", f)
    }

    function p(f, m) {
      f(m), o.shift(), o.length && c(o[0][0], o[0][1])
    }
  }

  function jh(r) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var e = r[Symbol.asyncIterator],
      i;
    return e ? e.call(r) : (r = typeof Tt == "function" ? Tt(r) : r[Symbol.iterator](), i = {}, n("next"), n("throw"), n("return"), i[Symbol.asyncIterator] = function () {
      return this
    }, i);

    function n(o) {
      i[o] = r[o] && function (a) {
        return new Promise(function (c, h) {
          a = r[o](a), s(c, h, a.done, a.value)
        })
      }
    }

    function s(o, a, c, h) {
      Promise.resolve(h).then(function (u) {
        o({
          value: u,
          done: c
        })
      }, a)
    }
  }

  function ue(r) {
    return typeof r == "function"
  }

  function ss(r) {
    var e = function (n) {
        Error.call(n), n.stack = new Error().stack
      },
      i = r(e);
    return i.prototype = Object.create(Error.prototype), i.prototype.constructor = i, i
  }
  var wr = ss(function (r) {
    return function (i) {
      r(this), this.message = i ? i.length + ` errors occurred during unsubscription:
` + i.map(function (n, s) {
        return s + 1 + ") " + n.toString()
      }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = i
    }
  });

  function Cr(r, e) {
    if (r) {
      var i = r.indexOf(e);
      0 <= i && r.splice(i, 1)
    }
  }
  var Si = function () {
      function r(e) {
        this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null
      }
      return r.prototype.unsubscribe = function () {
        var e, i, n, s, o;
        if (!this.closed) {
          this.closed = !0;
          var a = this._parentage;
          if (a)
            if (this._parentage = null, Array.isArray(a)) try {
              for (var c = Tt(a), h = c.next(); !h.done; h = c.next()) {
                var u = h.value;
                u.remove(this)
              }
            } catch (y) {
              e = {
                error: y
              }
            } finally {
              try {
                h && !h.done && (i = c.return) && i.call(c)
              } finally {
                if (e) throw e.error
              }
            } else a.remove(this);
          var d = this.initialTeardown;
          if (ue(d)) try {
            d()
          } catch (y) {
            o = y instanceof wr ? y.errors : [y]
          }
          var p = this._finalizers;
          if (p) {
            this._finalizers = null;
            try {
              for (var f = Tt(p), m = f.next(); !m.done; m = f.next()) {
                var g = m.value;
                try {
                  ls(g)
                } catch (y) {
                  o = o != null ? o : [], y instanceof wr ? o = ze(ze([], ke(o)), ke(y.errors)) : o.push(y)
                }
              }
            } catch (y) {
              n = {
                error: y
              }
            } finally {
              try {
                m && !m.done && (s = f.return) && s.call(f)
              } finally {
                if (n) throw n.error
              }
            }
          }
          if (o) throw new wr(o)
        }
      }, r.prototype.add = function (e) {
        var i;
        if (e && e !== this)
          if (this.closed) ls(e);
          else {
            if (e instanceof r) {
              if (e.closed || e._hasParent(this)) return;
              e._addParent(this)
            }(this._finalizers = (i = this._finalizers) !== null && i !== void 0 ? i : []).push(e)
          }
      }, r.prototype._hasParent = function (e) {
        var i = this._parentage;
        return i === e || Array.isArray(i) && i.includes(e)
      }, r.prototype._addParent = function (e) {
        var i = this._parentage;
        this._parentage = Array.isArray(i) ? (i.push(e), i) : i ? [i, e] : e
      }, r.prototype._removeParent = function (e) {
        var i = this._parentage;
        i === e ? this._parentage = null : Array.isArray(i) && Cr(i, e)
      }, r.prototype.remove = function (e) {
        var i = this._finalizers;
        i && Cr(i, e), e instanceof r && e._removeParent(this)
      }, r.EMPTY = function () {
        var e = new r;
        return e.closed = !0, e
      }(), r
    }(),
    os = Si.EMPTY;

  function as(r) {
    return r instanceof Si || r && "closed" in r && ue(r.remove) && ue(r.add) && ue(r.unsubscribe)
  }

  function ls(r) {
    ue(r) ? r() : r.unsubscribe()
  }
  var xr = {
      onUnhandledError: null,
      onStoppedNotification: null,
      Promise: void 0,
      useDeprecatedSynchronousErrorHandling: !1,
      useDeprecatedNextContext: !1
    },
    br = {
      setTimeout: function (r, e) {
        for (var i = [], n = 2; n < arguments.length; n++) i[n - 2] = arguments[n];
        var s = br.delegate;
        return (s == null ? void 0 : s.setTimeout) ? s.setTimeout.apply(s, ze([r, e], ke(i))) : setTimeout.apply(void 0, ze([r, e], ke(i)))
      },
      clearTimeout: function (r) {
        var e = br.delegate;
        return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(r)
      },
      delegate: void 0
    };

  function cs(r) {
    br.setTimeout(function () {
      throw r
    })
  }

  function hs() {}
  var Ti = null;

  function Mi(r) {
    if (xr.useDeprecatedSynchronousErrorHandling) {
      var e = !Ti;
      if (e && (Ti = {
          errorThrown: !1,
          error: null
        }), r(), e) {
        var i = Ti,
          n = i.errorThrown,
          s = i.error;
        if (Ti = null, n) throw s
      }
    } else r()
  }
  var Ar = function (r) {
      St(e, r);

      function e(i) {
        var n = r.call(this) || this;
        return n.isStopped = !1, i ? (n.destination = i, as(i) && i.add(n)) : n.destination = Xh, n
      }
      return e.create = function (i, n, s) {
        return new qt(i, n, s)
      }, e.prototype.next = function (i) {
        this.isStopped || this._next(i)
      }, e.prototype.error = function (i) {
        this.isStopped || (this.isStopped = !0, this._error(i))
      }, e.prototype.complete = function () {
        this.isStopped || (this.isStopped = !0, this._complete())
      }, e.prototype.unsubscribe = function () {
        this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null)
      }, e.prototype._next = function (i) {
        this.destination.next(i)
      }, e.prototype._error = function (i) {
        try {
          this.destination.error(i)
        } finally {
          this.unsubscribe()
        }
      }, e.prototype._complete = function () {
        try {
          this.destination.complete()
        } finally {
          this.unsubscribe()
        }
      }, e
    }(Si),
    qh = Function.prototype.bind;

  function Pr(r, e) {
    return qh.call(r, e)
  }
  var Qh = function () {
      function r(e) {
        this.partialObserver = e
      }
      return r.prototype.next = function (e) {
        var i = this.partialObserver;
        if (i.next) try {
          i.next(e)
        } catch (n) {
          Ei(n)
        }
      }, r.prototype.error = function (e) {
        var i = this.partialObserver;
        if (i.error) try {
          i.error(e)
        } catch (n) {
          Ei(n)
        } else Ei(e)
      }, r.prototype.complete = function () {
        var e = this.partialObserver;
        if (e.complete) try {
          e.complete()
        } catch (i) {
          Ei(i)
        }
      }, r
    }(),
    qt = function (r) {
      St(e, r);

      function e(i, n, s) {
        var o = r.call(this) || this,
          a;
        if (ue(i) || !i) a = {
          next: i != null ? i : void 0,
          error: n != null ? n : void 0,
          complete: s != null ? s : void 0
        };
        else {
          var c;
          o && xr.useDeprecatedNextContext ? (c = Object.create(i), c.unsubscribe = function () {
            return o.unsubscribe()
          }, a = {
            next: i.next && Pr(i.next, c),
            error: i.error && Pr(i.error, c),
            complete: i.complete && Pr(i.complete, c)
          }) : a = i
        }
        return o.destination = new Qh(a), o
      }
      return e
    }(Ar);

  function Ei(r) {
    cs(r)
  }

  function Yh(r) {
    throw r
  }
  var Xh = {
      closed: !0,
      next: hs,
      error: Yh,
      complete: hs
    },
    Sr = function () {
      return typeof Symbol == "function" && Symbol.observable || "@@observable"
    }();

  function us(r) {
    return r
  }

  function Kh(r) {
    return r.length === 0 ? us : r.length === 1 ? r[0] : function (i) {
      return r.reduce(function (n, s) {
        return s(n)
      }, i)
    }
  }
  var de = function () {
    function r(e) {
      e && (this._subscribe = e)
    }
    return r.prototype.lift = function (e) {
      var i = new r;
      return i.source = this, i.operator = e, i
    }, r.prototype.subscribe = function (e, i, n) {
      var s = this,
        o = $h(e) ? e : new qt(e, i, n);
      return Mi(function () {
        var a = s,
          c = a.operator,
          h = a.source;
        o.add(c ? c.call(o, h) : h ? s._subscribe(o) : s._trySubscribe(o))
      }), o
    }, r.prototype._trySubscribe = function (e) {
      try {
        return this._subscribe(e)
      } catch (i) {
        e.error(i)
      }
    }, r.prototype.forEach = function (e, i) {
      var n = this;
      return i = ds(i), new i(function (s, o) {
        var a = new qt({
          next: function (c) {
            try {
              e(c)
            } catch (h) {
              o(h), a.unsubscribe()
            }
          },
          error: o,
          complete: s
        });
        n.subscribe(a)
      })
    }, r.prototype._subscribe = function (e) {
      var i;
      return (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(e)
    }, r.prototype[Sr] = function () {
      return this
    }, r.prototype.pipe = function () {
      for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i];
      return Kh(e)(this)
    }, r.prototype.toPromise = function (e) {
      var i = this;
      return e = ds(e), new e(function (n, s) {
        var o;
        i.subscribe(function (a) {
          return o = a
        }, function (a) {
          return s(a)
        }, function () {
          return n(o)
        })
      })
    }, r.create = function (e) {
      return new r(e)
    }, r
  }();

  function ds(r) {
    var e;
    return (e = r != null ? r : xr.Promise) !== null && e !== void 0 ? e : Promise
  }

  function Jh(r) {
    return r && ue(r.next) && ue(r.error) && ue(r.complete)
  }

  function $h(r) {
    return r && r instanceof Ar || Jh(r) && as(r)
  }

  function Zh(r) {
    return ue(r == null ? void 0 : r.lift)
  }

  function Qe(r) {
    return function (e) {
      if (Zh(e)) return e.lift(function (i) {
        try {
          return r(i, this)
        } catch (n) {
          this.error(n)
        }
      });
      throw new TypeError("Unable to lift unknown Observable type")
    }
  }

  function Et(r, e, i, n, s) {
    return new eu(r, e, i, n, s)
  }
  var eu = function (r) {
      St(e, r);

      function e(i, n, s, o, a, c) {
        var h = r.call(this, i) || this;
        return h.onFinalize = a, h.shouldUnsubscribe = c, h._next = n ? function (u) {
          try {
            n(u)
          } catch (d) {
            i.error(d)
          }
        } : r.prototype._next, h._error = o ? function (u) {
          try {
            o(u)
          } catch (d) {
            i.error(d)
          } finally {
            this.unsubscribe()
          }
        } : r.prototype._error, h._complete = s ? function () {
          try {
            s()
          } catch (u) {
            i.error(u)
          } finally {
            this.unsubscribe()
          }
        } : r.prototype._complete, h
      }
      return e.prototype.unsubscribe = function () {
        var i;
        if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
          var n = this.closed;
          r.prototype.unsubscribe.call(this), !n && ((i = this.onFinalize) === null || i === void 0 || i.call(this))
        }
      }, e
    }(Ar),
    tu = ss(function (r) {
      return function () {
        r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed"
      }
    }),
    Di = function (r) {
      St(e, r);

      function e() {
        var i = r.call(this) || this;
        return i.closed = !1, i.currentObservers = null, i.observers = [], i.isStopped = !1, i.hasError = !1, i.thrownError = null, i
      }
      return e.prototype.lift = function (i) {
        var n = new ps(this, this);
        return n.operator = i, n
      }, e.prototype._throwIfClosed = function () {
        if (this.closed) throw new tu
      }, e.prototype.next = function (i) {
        var n = this;
        Mi(function () {
          var s, o;
          if (n._throwIfClosed(), !n.isStopped) {
            n.currentObservers || (n.currentObservers = Array.from(n.observers));
            try {
              for (var a = Tt(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
                var h = c.value;
                h.next(i)
              }
            } catch (u) {
              s = {
                error: u
              }
            } finally {
              try {
                c && !c.done && (o = a.return) && o.call(a)
              } finally {
                if (s) throw s.error
              }
            }
          }
        })
      }, e.prototype.error = function (i) {
        var n = this;
        Mi(function () {
          if (n._throwIfClosed(), !n.isStopped) {
            n.hasError = n.isStopped = !0, n.thrownError = i;
            for (var s = n.observers; s.length;) s.shift().error(i)
          }
        })
      }, e.prototype.complete = function () {
        var i = this;
        Mi(function () {
          if (i._throwIfClosed(), !i.isStopped) {
            i.isStopped = !0;
            for (var n = i.observers; n.length;) n.shift().complete()
          }
        })
      }, e.prototype.unsubscribe = function () {
        this.isStopped = this.closed = !0, this.observers = this.currentObservers = null
      }, Object.defineProperty(e.prototype, "observed", {
        get: function () {
          var i;
          return ((i = this.observers) === null || i === void 0 ? void 0 : i.length) > 0
        },
        enumerable: !1,
        configurable: !0
      }), e.prototype._trySubscribe = function (i) {
        return this._throwIfClosed(), r.prototype._trySubscribe.call(this, i)
      }, e.prototype._subscribe = function (i) {
        return this._throwIfClosed(), this._checkFinalizedStatuses(i), this._innerSubscribe(i)
      }, e.prototype._innerSubscribe = function (i) {
        var n = this,
          s = this,
          o = s.hasError,
          a = s.isStopped,
          c = s.observers;
        return o || a ? os : (this.currentObservers = null, c.push(i), new Si(function () {
          n.currentObservers = null, Cr(c, i)
        }))
      }, e.prototype._checkFinalizedStatuses = function (i) {
        var n = this,
          s = n.hasError,
          o = n.thrownError,
          a = n.isStopped;
        s ? i.error(o) : a && i.complete()
      }, e.prototype.asObservable = function () {
        var i = new de;
        return i.source = this, i
      }, e.create = function (i, n) {
        return new ps(i, n)
      }, e
    }(de),
    ps = function (r) {
      St(e, r);

      function e(i, n) {
        var s = r.call(this) || this;
        return s.destination = i, s.source = n, s
      }
      return e.prototype.next = function (i) {
        var n, s;
        (s = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || s === void 0 || s.call(n, i)
      }, e.prototype.error = function (i) {
        var n, s;
        (s = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || s === void 0 || s.call(n, i)
      }, e.prototype.complete = function () {
        var i, n;
        (n = (i = this.destination) === null || i === void 0 ? void 0 : i.complete) === null || n === void 0 || n.call(i)
      }, e.prototype._subscribe = function (i) {
        var n, s;
        return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(i)) !== null && s !== void 0 ? s : os
      }, e
    }(Di),
    iu = function (r) {
      St(e, r);

      function e(i) {
        var n = r.call(this) || this;
        return n._value = i, n
      }
      return Object.defineProperty(e.prototype, "value", {
        get: function () {
          return this.getValue()
        },
        enumerable: !1,
        configurable: !0
      }), e.prototype._subscribe = function (i) {
        var n = r.prototype._subscribe.call(this, i);
        return !n.closed && i.next(this._value), n
      }, e.prototype.getValue = function () {
        var i = this,
          n = i.hasError,
          s = i.thrownError,
          o = i._value;
        if (n) throw s;
        return this._throwIfClosed(), o
      }, e.prototype.next = function (i) {
        r.prototype.next.call(this, this._value = i)
      }, e
    }(Di),
    ru = new de(function (r) {
      return r.complete()
    });

  function nu(r) {
    return r && ue(r.schedule)
  }

  function Tr(r) {
    return r[r.length - 1]
  }

  function su(r) {
    return ue(Tr(r)) ? r.pop() : void 0
  }

  function fs(r) {
    return nu(Tr(r)) ? r.pop() : void 0
  }

  function ou(r, e) {
    return typeof Tr(r) == "number" ? r.pop() : e
  }
  var ms = function (r) {
    return r && typeof r.length == "number" && typeof r != "function"
  };

  function gs(r) {
    return ue(r == null ? void 0 : r.then)
  }

  function ys(r) {
    return ue(r[Sr])
  }

  function vs(r) {
    return Symbol.asyncIterator && ue(r == null ? void 0 : r[Symbol.asyncIterator])
  }

  function _s(r) {
    return new TypeError("You provided " + (r !== null && typeof r == "object" ? "an invalid object" : "'" + r + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")
  }

  function au() {
    return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator
  }
  var ws = au();

  function Cs(r) {
    return ue(r == null ? void 0 : r[ws])
  }

  function xs(r) {
    return Wh(this, arguments, function () {
      var i, n, s, o;
      return ns(this, function (a) {
        switch (a.label) {
          case 0:
            i = r.getReader(), a.label = 1;
          case 1:
            a.trys.push([1, , 9, 10]), a.label = 2;
          case 2:
            return [4, Mt(i.read())];
          case 3:
            return n = a.sent(), s = n.value, o = n.done, o ? [4, Mt(void 0)] : [3, 5];
          case 4:
            return [2, a.sent()];
          case 5:
            return [4, Mt(s)];
          case 6:
            return [4, a.sent()];
          case 7:
            return a.sent(), [3, 2];
          case 8:
            return [3, 10];
          case 9:
            return i.releaseLock(), [7];
          case 10:
            return [2]
        }
      })
    })
  }

  function bs(r) {
    return ue(r == null ? void 0 : r.getReader)
  }

  function ut(r) {
    if (r instanceof de) return r;
    if (r != null) {
      if (ys(r)) return lu(r);
      if (ms(r)) return cu(r);
      if (gs(r)) return hu(r);
      if (vs(r)) return As(r);
      if (Cs(r)) return uu(r);
      if (bs(r)) return du(r)
    }
    throw _s(r)
  }

  function lu(r) {
    return new de(function (e) {
      var i = r[Sr]();
      if (ue(i.subscribe)) return i.subscribe(e);
      throw new TypeError("Provided object does not correctly implement Symbol.observable")
    })
  }

  function cu(r) {
    return new de(function (e) {
      for (var i = 0; i < r.length && !e.closed; i++) e.next(r[i]);
      e.complete()
    })
  }

  function hu(r) {
    return new de(function (e) {
      r.then(function (i) {
        e.closed || (e.next(i), e.complete())
      }, function (i) {
        return e.error(i)
      }).then(null, cs)
    })
  }

  function uu(r) {
    return new de(function (e) {
      var i, n;
      try {
        for (var s = Tt(r), o = s.next(); !o.done; o = s.next()) {
          var a = o.value;
          if (e.next(a), e.closed) return
        }
      } catch (c) {
        i = {
          error: c
        }
      } finally {
        try {
          o && !o.done && (n = s.return) && n.call(s)
        } finally {
          if (i) throw i.error
        }
      }
      e.complete()
    })
  }

  function As(r) {
    return new de(function (e) {
      pu(r, e).catch(function (i) {
        return e.error(i)
      })
    })
  }

  function du(r) {
    return As(xs(r))
  }

  function pu(r, e) {
    var i, n, s, o;
    return Vh(this, void 0, void 0, function () {
      var a, c;
      return ns(this, function (h) {
        switch (h.label) {
          case 0:
            h.trys.push([0, 5, 6, 11]), i = jh(r), h.label = 1;
          case 1:
            return [4, i.next()];
          case 2:
            if (n = h.sent(), !!n.done) return [3, 4];
            if (a = n.value, e.next(a), e.closed) return [2];
            h.label = 3;
          case 3:
            return [3, 1];
          case 4:
            return [3, 11];
          case 5:
            return c = h.sent(), s = {
              error: c
            }, [3, 11];
          case 6:
            return h.trys.push([6, , 9, 10]), n && !n.done && (o = i.return) ? [4, o.call(i)] : [3, 8];
          case 7:
            h.sent(), h.label = 8;
          case 8:
            return [3, 10];
          case 9:
            if (s) throw s.error;
            return [7];
          case 10:
            return [7];
          case 11:
            return e.complete(), [2]
        }
      })
    })
  }

  function tt(r, e, i, n, s) {
    n === void 0 && (n = 0), s === void 0 && (s = !1);
    var o = e.schedule(function () {
      i(), s ? r.add(this.schedule(null, n)) : this.unsubscribe()
    }, n);
    if (r.add(o), !s) return o
  }

  function Ps(r, e) {
    return e === void 0 && (e = 0), Qe(function (i, n) {
      i.subscribe(Et(n, function (s) {
        return tt(n, r, function () {
          return n.next(s)
        }, e)
      }, function () {
        return tt(n, r, function () {
          return n.complete()
        }, e)
      }, function (s) {
        return tt(n, r, function () {
          return n.error(s)
        }, e)
      }))
    })
  }

  function Ss(r, e) {
    return e === void 0 && (e = 0), Qe(function (i, n) {
      n.add(r.schedule(function () {
        return i.subscribe(n)
      }, e))
    })
  }

  function fu(r, e) {
    return ut(r).pipe(Ss(e), Ps(e))
  }

  function mu(r, e) {
    return ut(r).pipe(Ss(e), Ps(e))
  }

  function gu(r, e) {
    return new de(function (i) {
      var n = 0;
      return e.schedule(function () {
        n === r.length ? i.complete() : (i.next(r[n++]), i.closed || this.schedule())
      })
    })
  }

  function yu(r, e) {
    return new de(function (i) {
      var n;
      return tt(i, e, function () {
          n = r[ws](), tt(i, e, function () {
            var s, o, a;
            try {
              s = n.next(), o = s.value, a = s.done
            } catch (c) {
              i.error(c);
              return
            }
            a ? i.complete() : i.next(o)
          }, 0, !0)
        }),
        function () {
          return ue(n == null ? void 0 : n.return) && n.return()
        }
    })
  }

  function Ts(r, e) {
    if (!r) throw new Error("Iterable cannot be null");
    return new de(function (i) {
      tt(i, e, function () {
        var n = r[Symbol.asyncIterator]();
        tt(i, e, function () {
          n.next().then(function (s) {
            s.done ? i.complete() : i.next(s.value)
          })
        }, 0, !0)
      })
    })
  }

  function vu(r, e) {
    return Ts(xs(r), e)
  }

  function _u(r, e) {
    if (r != null) {
      if (ys(r)) return fu(r, e);
      if (ms(r)) return gu(r, e);
      if (gs(r)) return mu(r, e);
      if (vs(r)) return Ts(r, e);
      if (Cs(r)) return yu(r, e);
      if (bs(r)) return vu(r, e)
    }
    throw _s(r)
  }

  function Ms(r, e) {
    return e ? _u(r, e) : ut(r)
  }

  function wu(r, e) {
    return Qe(function (i, n) {
      var s = 0;
      i.subscribe(Et(n, function (o) {
        n.next(r.call(e, o, s++))
      }))
    })
  }

  function Cu(r, e, i, n, s, o, a, c) {
    var h = [],
      u = 0,
      d = 0,
      p = !1,
      f = function () {
        p && !h.length && !u && e.complete()
      },
      m = function (y) {
        return u < n ? g(y) : h.push(y)
      },
      g = function (y) {
        o && e.next(y), u++;
        var x = !1;
        ut(i(y, d++)).subscribe(Et(e, function (A) {
          s == null || s(A), o ? m(A) : e.next(A)
        }, function () {
          x = !0
        }, void 0, function () {
          if (x) try {
            u--;
            for (var A = function () {
                var _ = h.shift();
                a ? tt(e, a, function () {
                  return g(_)
                }) : g(_)
              }; h.length && u < n;) A();
            f()
          } catch (_) {
            e.error(_)
          }
        }))
      };
    return r.subscribe(Et(e, m, function () {
        p = !0, f()
      })),
      function () {
        c == null || c()
      }
  }

  function Es(r, e, i) {
    return i === void 0 && (i = 1 / 0), ue(e) ? Es(function (n, s) {
      return wu(function (o, a) {
        return e(n, o, s, a)
      })(ut(r(n, s)))
    }, i) : (typeof e == "number" && (i = e), Qe(function (n, s) {
      return Cu(n, s, r, i)
    }))
  }

  function Ds(r) {
    return r === void 0 && (r = 1 / 0), Es(us, r)
  }

  function xu() {
    return Ds(1)
  }
  var bu = Array.isArray;

  function ks(r) {
    return r.length === 1 && bu(r[0]) ? r[0] : r
  }

  function Au(r, e) {
    return Qe(function (i, n) {
      var s = 0;
      i.subscribe(Et(n, function (o) {
        return r.call(e, o, s++) && n.next(o)
      }))
    })
  }

  function Pu() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    var i = su(r),
      n = ks(r);
    return n.length ? new de(function (s) {
      var o = n.map(function () {
          return []
        }),
        a = n.map(function () {
          return !1
        });
      s.add(function () {
        o = a = null
      });
      for (var c = function (u) {
          ut(n[u]).subscribe(Et(s, function (d) {
            if (o[u].push(d), o.every(function (f) {
                return f.length
              })) {
              var p = o.map(function (f) {
                return f.shift()
              });
              s.next(i ? i.apply(void 0, ze([], ke(p))) : p), o.some(function (f, m) {
                return !f.length && a[m]
              }) && s.complete()
            }
          }, function () {
            a[u] = !0, !o[u].length && s.complete()
          }))
        }, h = 0; !s.closed && h < n.length; h++) c(h);
      return function () {
        o = a = null
      }
    }) : ru
  }

  function Su() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    var i = fs(r);
    return Qe(function (n, s) {
      xu()(Ms(ze([n], ke(r)), i)).subscribe(s)
    })
  }

  function Tu() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    return Su.apply(void 0, ze([], ke(r)))
  }

  function Mu() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    var i = fs(r),
      n = ou(r, 1 / 0);
    return r = ks(r), Qe(function (s, o) {
      Ds(n)(Ms(ze([s], ke(r)), i)).subscribe(o)
    })
  }

  function Mr() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    return Mu.apply(void 0, ze([], ke(r)))
  }

  function Er(r) {
    r === void 0 && (r = {});
    var e = r.connector,
      i = e === void 0 ? function () {
        return new Di
      } : e,
      n = r.resetOnError,
      s = n === void 0 ? !0 : n,
      o = r.resetOnComplete,
      a = o === void 0 ? !0 : o,
      c = r.resetOnRefCountZero,
      h = c === void 0 ? !0 : c;
    return function (u) {
      var d, p, f, m = 0,
        g = !1,
        y = !1,
        x = function () {
          p == null || p.unsubscribe(), p = void 0
        },
        A = function () {
          x(), d = f = void 0, g = y = !1
        },
        _ = function () {
          var v = d;
          A(), v == null || v.unsubscribe()
        };
      return Qe(function (v, b) {
        m++, !y && !g && x();
        var C = f = f != null ? f : i();
        b.add(function () {
          m--, m === 0 && !y && !g && (p = Dr(_, h))
        }), C.subscribe(b), !d && m > 0 && (d = new qt({
          next: function (M) {
            return C.next(M)
          },
          error: function (M) {
            y = !0, x(), p = Dr(A, s, M), C.error(M)
          },
          complete: function () {
            g = !0, x(), p = Dr(A, a), C.complete()
          }
        }), ut(v).subscribe(d))
      })(u)
    }
  }

  function Dr(r, e) {
    for (var i = [], n = 2; n < arguments.length; n++) i[n - 2] = arguments[n];
    if (e === !0) {
      r();
      return
    }
    if (e !== !1) {
      var s = new qt({
        next: function () {
          s.unsubscribe(), r()
        }
      });
      return e.apply(void 0, ze([], ke(i))).subscribe(s)
    }
  }

  function Eu() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    return Qe(function (i, n) {
      Pu.apply(void 0, ze([i], ke(r))).subscribe(n)
    })
  }

  function Qt() {
    for (var r = [], e = 0; e < arguments.length; e++) r[e] = arguments[e];
    return Eu.apply(void 0, ze([], ke(r)))
  }

  function zs({
    handler: r,
    map: e,
    type: i,
    eventName: n
  }) {
    return new de(s => (r.setInputAction(o => {
      s.next(Du({
        event: o,
        map: e
      }))
    }, i), () => {
      r.removeInputAction(i)
    }))
  }

  function Du({
    event: r,
    map: e
  }) {
    const i = e.viewer,
      n = r.position || r.endPosition;
    if (!n) return r;
    const s = i.camera.pickEllipsoid(n, i.scene.globe.ellipsoid);
    let o = i.scene.pick(n),
      a = o && (o.id || o.primitive),
      c = a && a._parentGraphic;
    if (c && c.forbidEvent) {
      o = null, a = null, c = null;
      const h = i.scene.drillPick(n);
      for (const u of h)
        if (o = u, a = o && (o.id || o.primitive), c = a && a._parentGraphic, c)
          if (c.forbidEvent) o = null, a = null, c = null;
          else break
    }
    return {
      event: r,
      position: n,
      target: a,
      targetGraphic: a && a._parentGraphic,
      get point() {
        var u;
        let h;
        return o && (((u = o == null ? void 0 : o.primitive) == null ? void 0 : u.disableDepthTestDistance) === 1 / 0 ? (o.primitive.disableDepthTestDistance = 0, i.scene.render(), h = i.scene.pickPosition(n), o.primitive.disableDepthTestDistance = 1 / 0) : h = i.scene.pickPosition(n)), h = h && new R(h), h && h.height >= -500 ? h : this.globePoint
      },
      get ellipsoidPoint() {
        return s && new R(s)
      },
      get globePoint() {
        const h = i.scene.globe.pick(i.camera.getPickRay(n), i.scene);
        return h && new R(h)
      },
      feature: o,
      get features() {
        return i.scene.drillPick(n)
      },
      intersection: h => e.intersection(n, h)
    }
  }

  function ku({
    map: r,
    type: e
  }) {
    return new de(i => {
      const n = s => {
        const o = r.camera;
        i.next({
          camera: {
            heading: o.heading,
            pitch: o.pitch,
            roll: o.roll,
            positionWC: o.positionWC
          },
          event: s
        })
      };
      return r.viewer.scene[e].addEventListener(n), () => {
        r.viewer.scene[e].removeEventListener(n)
      }
    })
  }

  function zu({
    map: r,
    type: e
  }) {
    return new de(i => {
      const n = s => {
        const o = r.camera;
        i.next({
          event: s,
          camera: {
            heading: o.heading,
            pitch: o.pitch,
            roll: o.roll,
            positionWC: o.positionWC
          }
        })
      };
      return r.viewer.camera[e].addEventListener(n), () => {
        r.viewer.camera[e].removeEventListener(n)
      }
    })
  }

  function Iu({
    map: r,
    type: e
  }) {
    return new de(i => {
      const n = s => {
        i.next({
          event: s
        })
      };
      return r.viewer.clock[e].addEventListener(n), () => {
        r.viewer.clock[e].removeEventListener(n)
      }
    })
  }

  function ki() {
    return new Di
  }
  const Yt = {
      [K.Click]: l.ScreenSpaceEventType.LEFT_CLICK,
      [K.RClick]: l.ScreenSpaceEventType.RIGHT_CLICK,
      [K.DbClick]: l.ScreenSpaceEventType.LEFT_DOUBLE_CLICK,
      [K.Mousemove]: l.ScreenSpaceEventType.MOUSE_MOVE,
      [K.Mousedown]: l.ScreenSpaceEventType.LEFT_DOWN,
      [K.Mouseup]: l.ScreenSpaceEventType.LEFT_UP,
      [K.RightMousedown]: l.ScreenSpaceEventType.RIGHT_DOWN,
      [K.RightMouseup]: l.ScreenSpaceEventType.RIGHT_UP,
      [K.Middledown]: l.ScreenSpaceEventType.MIDDLE_DOWN,
      [K.Middleup]: l.ScreenSpaceEventType.MIDDLE_UP,
      [K.MiddleClick]: l.ScreenSpaceEventType.MIDDLE_CLICK,
      [K.Wheel]: l.ScreenSpaceEventType.WHEEL,
      [K.PinchStart]: l.ScreenSpaceEventType.PINCH_START,
      [K.PinchEnd]: l.ScreenSpaceEventType.PINCH_END,
      [K.PinchMove]: l.ScreenSpaceEventType.PINCH_MOVE
    },
    Is = {
      [K.MorphComplete]: "morphComplete",
      [K.MorphStart]: "morphStart",
      [K.PostRender]: "postRender",
      [K.PreRender]: "preRender",
      [K.PostUpdate]: "postUpdate",
      [K.PreUpdate]: "preUpdate",
      [K.RenderError]: "renderError",
      [K.TerrainProviderChanged]: "terrainProviderChanged"
    },
    Os = {
      [K.CameraChanged]: "changed",
      [K.CameraMoveEnd]: "moveEnd",
      [K.CameraMoveStart]: "moveStart"
    },
    Rs = {
      [K.ClockStop]: "onStop",
      [K.ClockTick]: "onTick"
    },
    kr = () => {
      let r = ki();
      return {
        fireSubject: r,
        observer: r,
        subscriptionMap: new Map
      }
    },
    Ou = ({
      eventName: r,
      graphic: e
    }) => {
      if (ce(Yt[r]) && ![K.Mouseenter, K.Mouseleave].includes(r)) return kr();
      const i = ki(),
        n = new iu(null),
        s = new de(o => {
          const a = n.getValue();
          let c;
          if ([K.Mouseenter, K.Mouseleave].includes(r)) {
            let h = null;
            c = a.events[K.Mousemove].observer.subscribe(([u, ...d]) => {
              K.Mouseenter === r && h !== e && u.targetGraphic === e && (u.fromGraphic = h, u.toGraphic = u.targetGraphic, o.next([u, ...d])), K.Mouseleave === r && h === e && u.targetGraphic !== e && (u.fromGraphic = h, u.toGraphic = u.targetGraphic, o.next([u, ...d])), h = u.targetGraphic
            })
          } else c = a.events[r].observer.subscribe(([h, ...u]) => {
            h && h.targetGraphic === e && o.next([h, ...u])
          });
          return () => {
            c.unsubscribe()
          }
        });
      return {
        fireSubject: i,
        addedToMapSubject: n,
        observer: i.pipe(Mr(n.pipe(Au(() => !1), Tu(s))), Er()),
        subscriptionMap: new Map
      }
    },
    Ru = ({
      handler: r,
      map: e,
      eventName: i
    }) => {
      let n = ki(),
        s;
      if (ce(Yt[i]) || (s = zs({
          handler: r,
          map: e,
          type: Yt[i],
          eventName: i
        }).pipe(Qt())), ce(Is[i]) || (s = ku({
          map: e,
          type: Is[i]
        }).pipe(Qt())), ce(Os[i]) || (s = zu({
          map: e,
          type: Os[i]
        }).pipe(Qt())), ce(Rs[i]) || (s = Iu({
          map: e,
          type: Rs[i]
        }).pipe(Qt())), !s) return kr();
      let o = n.pipe(Mr(s), Er());
      return {
        fireSubject: n,
        eventObserver: s,
        observer: o,
        subscriptionMap: new Map
      }
    },
    Bu = ({
      handler: r,
      map: e,
      eventName: i
    }) => {
      let n = ki(),
        s = zs({
          handler: r,
          map: e,
          type: Yt[i],
          eventName: i
        }).pipe(Qt());
      const o = new de(c => {
        let h = !1,
          u = [s.subscribe(([d, ...p]) => {
            h || c.next([d, ...p])
          }), e.events[K.Mousedown].observer.subscribe(() => {
            h = !0
          }), e.events[K.RightMousedown].observer.subscribe(() => {
            h = !0
          }), e.events[K.Middledown].observer.subscribe(() => {
            h = !0
          }), e.events[K.Mouseup].observer.subscribe(() => {
            h = !1
          }), e.events[K.RightMouseup].observer.subscribe(() => {
            h = !1
          }), e.events[K.Middleup].observer.subscribe(() => {
            h = !1
          })];
        return () => {
          u.forEach(d => d.unsubscribe()), u = null
        }
      });
      let a = n.pipe(Mr(o), Er());
      return {
        fireSubject: n,
        eventObserver: o,
        observer: a,
        subscriptionMap: new Map
      }
    };
  class Lu extends vr {
    _createObserver(e) {
      const i = Ou({
        eventName: e,
        graphic: this
      });
      return i.addedToMapSubject && (this._map ? (i.addedToMapSubject.next(this._map), i.addedToMapSubject.complete()) : this.once("addToMap", n => {
        i.addedToMapSubject.next(n), i.addedToMapSubject.complete()
      })), i
    }
  }
  class it extends Lu {
    constructor() {
      super();
      this.state = me.INITIALIZED
    }
    _onAddToMap(e) {
      this._map = e, this._addedHook(), this.state = me.ADDED
    }
    _addedHook() {}
    destroy() {
      this.state = me.DESTROYED, super.destroy(), this._map = null
    }
  }
  const Gu = r => r instanceof l.Color,
    be = (r, e, {
      forceFormat: i = !1
    } = {}) => r && r.getValue ? i ? new l.CallbackProperty(() => {
      try {
        return e(r.getValue())
      } catch (n) {
        console.warn(n)
      }
    }, !1) : r : Oe(r) ? new l.CallbackProperty(() => e(r()), !1) : e(r),
    Fu = (r = [], e) => r.some(i => i && i.getValue || Oe(i)) ? new l.CallbackProperty(() => {
      try {
        return e(r.map(i => i && i.getValue ? i.getValue() : Oe(i) ? i() : i))
      } catch (i) {
        console.warn(i)
      }
    }, !1) : e(r),
    rt = r => {
      if (U(r)) return Gu(r) ? r : l.Color.fromCssColorString(r)
    },
    Z = r => e => {
      U(e[r]) && (e[r] = be(e[r], rt))
    },
    ee = (r, e) => i => {
      const n = i[r];
      U(n) && (i[r] = be(n, s => {
        var o, a;
        return (a = e[(o = s.toUpperCase) == null ? void 0 : o.call(s)]) != null ? a : s
      }))
    },
    $ = (r, e) => i => {
      const n = i[r];
      U(n) && (i[r] = be(n, s => {
        if (s instanceof e) return s;
        const o = Ie(s) ? s : Array(e.length).fill(s);
        return new e(...o)
      }))
    },
    Ge = (r, e) => i => {
      var n;
      U(i[e]) && (i[r] = (n = i[e]) != null ? n : i[r])
    },
    _e = r => e => {
      const i = e.opacity;
      U(i) && r.forEach(n => {
        n === "material" && e[n].getValue || (e[n] = Fu([e[n], i], ([s = "#fff", o]) => rt(s).withAlpha(o)))
      })
    },
    oe = (r, e) => {
      const i = j({}, e);
      return r.forEach(n => {
        n(i)
      }), i
    },
    Hu = [Z("evenColor"), Z("oddColor"), $("repeat", l.Cartesian2)];
  class Nu extends l.CheckerboardMaterialProperty {
    constructor(e) {
      super(oe(Hu, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  var Uu = `
#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
#else
  #define TEXTURE_FUNC texture2D
#endif

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec2 st = materialInput.st;
    float angle;
    angle = speed * czm_frameNumber/600.0;
    st-=0.5;
    st = mat2(cos(angle),-sin(angle),
                sin(angle),cos(angle)) * st;
    st+=0.5;
    
    vec4 imgC = TEXTURE_FUNC(image, st);
    
    if(imgC.a>.0){
        material.diffuse = color.rgb;
    }
    material.alpha = imgC.a * color.a;
    return material;
}
`;
  class Me {
    constructor(e) {
      this.options = e, this._definitionChanged = new l.Event
    }
    get typeName() {
      return `${this.type}Type`
    }
    getType() {
      return this.type
    }
    get isConstant() {
      return !0
    }
    equals(e) {
      return e === this
    }
    get definitionChanged() {
      return this._definitionChanged
    }
    getValue(e, i) {
      return i || (i = {}), i.isStart || (i.isStart = !0, Object.keys(this.options).forEach(n => {
        i[n] = this.options[n]
      })), i
    }
  }
  const Vu = {
      image: "",
      color: new l.Color(1, 0, 0, 0),
      speed: 10
    },
    Wu = [Z("color")];
  class ju extends Me {
    constructor(e) {
      super(oe(Wu, e));
      P(this, "type", "CircleScan");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Vu,
          source: Uu
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var qu = `
czm_material czm_getMaterial(czm_materialInput materialInput)
{
  czm_material material = czm_getDefaultMaterial(materialInput);
  material.diffuse = 1.5 * color.rgb;
  vec2 st = materialInput.st;

  float dis = distance(st, vec2(0.5, 0.5));
  float per = fract(speed*czm_frameNumber/1000.0);
  if(count==1.0){
    if(dis > per * 0.5){
      discard;
    }else {
      material.alpha = color.a  * dis / per / 2.0;
    }
  }
  else{
    vec3 str = materialInput.str;
    if(abs(str.z)>0.001){
      discard;
    }
    if(dis >0.5){
      discard;
    }
    else {
      float perDis = 0.5/count;
      float disNum;
      float bl = 0.0;
      for(int i=0;i<=999;i++){
        if(float(i)<=count){
          disNum = perDis*float(i) - dis + per/count;
          if(disNum>0.0){
            if(disNum<perDis){
              bl = 1.0-disNum/perDis;
            }
            else if(disNum-perDis<perDis){
              bl = 1.0 - abs(1.0-disNum/perDis);
            }
            material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));
          }
        }
      }
    }
  }
  return material;
}
`;
  const Qu = {
      speed: 10,
      color: new l.Color(1, 1, 0, 1),
      count: 1,
      gradient: .1
    },
    Yu = [Z("color")];
  class Xu extends Me {
    constructor(e) {
      super(oe(Yu, e));
      P(this, "type", "CircleWave");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Qu,
          source: qu
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  const Ku = [Z("color")];
  class Ju extends l.ColorMaterialProperty {
    constructor(e) {
      super(oe(Ku, e).color);
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const $u = [Z("color"), $("lineCount", l.Cartesian2), $("lineThickness", l.Cartesian2), $("lineOffset", l.Cartesian2)];
  class Zu extends l.GridMaterialProperty {
    constructor(e) {
      super(oe($u, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const ed = [Z("color"), $("repeat", l.Cartesian2)];
  class td extends l.ImageMaterialProperty {
    constructor(e) {
      super(j({
        transparent: !0
      }, oe(ed, e)));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  var id = `
#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
#else
  #define TEXTURE_FUNC texture2D
#endif

czm_material czm_getMaterial(czm_materialInput materialInput)
{
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st = repeat * materialInput.st;

  float currTime;
  if(time < 0.0){
    currTime = speed*czm_frameNumber/1000.0;
  }
  else{
    currTime = time;
  }

  vec4 colorImage = TEXTURE_FUNC(image, vec2(fract((axisY?st.t:st.s) - currTime), st.t));
  if(color.a == 0.0) {
    if(colorImage.rgb == vec3(1.0)){
      discard;
    }
    material.alpha = colorImage.a;
    material.diffuse = colorImage.rgb;
  }
  else {
    material.alpha = colorImage.a * color.a;
    material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);
  }

  if(hasImage2)  {
    vec4 colorBG = TEXTURE_FUNC(image2,materialInput.st);
    if(colorBG.a>0.5){
      material.diffuse = color2.rgb;
    }
  }
  return material;
}
`;
  const rd = {
      time: -1,
      image: "",
      color: new l.Color(1, 0, 0, 1),
      repeat: new l.Cartesian2(1, 1),
      axisY: !1,
      speed: 10,
      hasImage2: !1,
      image2: "",
      color2: new l.Color(1, 1, 1)
    },
    nd = [Z("color"), Z("color2"), $("repeat", l.Cartesian2), r => {
      r.image2 && (r.hasImage2 = !0)
    }];
  class sd extends Me {
    constructor(e) {
      super(oe(nd, e));
      P(this, "type", "LineFlow");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: rd,
          source: id
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  const od = [Z("color")];
  class ad extends l.PolylineArrowMaterialProperty {
    constructor(e) {
      super(oe(od, e).color);
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const ld = [Z("color"), Z("gapColor")];
  class cd extends l.PolylineDashMaterialProperty {
    constructor(e) {
      super(oe(ld, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const hd = [Z("color")];
  class ud extends l.PolylineGlowMaterialProperty {
    constructor(e) {
      super(oe(hd, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const dd = [Z("color"), Z("outlineColor")];
  class pd extends l.PolylineOutlineMaterialProperty {
    constructor(e) {
      super(oe(dd, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const fd = [Z("evenColor"), Z("oddColor"), ee("orientation", l.StripeOrientation)];
  class md extends l.StripeMaterialProperty {
    constructor(e) {
      super(oe(fd, e));
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  const gd = [Z("baseWaterColor"), Z("blendColor")];
  class yd extends Me {
    constructor(e) {
      super(oe(gd, e));
      P(this, "type", "Water");
      this.depthTest = e.depthTest
    }
    getValue(e, i) {
      const n = super.getValue(e, i);
      return U(this.depthTest) && (n.depthTest = this.depthTest), n
    }
  }
  var vd = `
uniform vec4 color;
uniform vec4 bgColor;
uniform float speed;
uniform float startTime;
uniform float bidirectional;
#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
#else
  #define TEXTURE_FUNC texture2D
#endif

czm_material czm_getMaterial(czm_materialInput materialInput)
{
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st = materialInput.st;
  float t = fract(startTime + czm_frameNumber * speed / 1000.0);

  t *= 1.03;
  float alpha0 = smoothstep(t - 0.03, t, st.s) * step(st.s, t);
  float mt = 1. - t;
  float alpha1 = smoothstep(mt + 0.03, mt, st.s) * step(mt, st.s);

  float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.);
  float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.);
  float db = step(abs(bidirectional - 2.0) - 0.001, 0.);
  float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db);
  alpha = clamp(alpha, 0., 1.);

  material.diffuse = color.rgb * alpha + bgColor.rgb * (1. - alpha);
  material.alpha = color.a * alpha + bgColor.a * (1. - alpha);

  // if (useImageAndRepeat.x != 0.) {
  //     float repeat = useImageAndRepeat.y;
  //     vec4 marsImageColor = TEXTURE_FUNC(image, fract(vec2(fract((st.s-t)*repeat), st.t)));
  //     material.diffuse = marsImageColor.rgb;
  //     material.alpha = marsImageColor.a;
  // }

  return material;
}
`;
  const _d = {
      bgColor: new l.Color(1, 1, 0, .1),
      color: new l.Color(1, 1, 0, .7),
      startTime: 0,
      speed: 20,
      bidirectional: 0
    },
    wd = [Z("color"), Z("bgColor")];
  class Cd extends Me {
    constructor(e) {
      super(oe(wd, e));
      P(this, "type", "ODLine");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: _d,
          source: vd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var xd = `uniform vec4 bgColor;
uniform vec4 color;
uniform float speed;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st = materialInput.st;
  float time = fract(czm_frameNumber * speed / 1000.0);

  vec3 fragColor = color.rgb;
  if(st.t > 0.45 && st.t < 0.55 ) {
    fragColor = vec3(1.0);
  }
  material.alpha =  color.a * 1.5 * smoothstep(.0,1., fract(st.s - time));
  material.diffuse = max(fragColor.rgb * material.alpha , fragColor.rgb);

  if(material.alpha < bgColor.a){
    material.alpha = bgColor.a;
    material.diffuse = bgColor.rgb;
  }

  return material;
}
`;
  const bd = {
      color: new l.Color(1, 1, 0, .7),
      bgColor: new l.Color(0, 0, 0, 0),
      speed: 5
    },
    Ad = [Z("color"), Z("bgColor")];
  class Pd extends Me {
    constructor(e) {
      super(oe(Ad, e));
      P(this, "type", "LineTrail");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: bd,
          source: xd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var Sd = `
uniform vec4 color;
uniform float speed;
uniform float startTime;
uniform float percent;
uniform float alpha;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st = materialInput.st;
  float t =fract(startTime +czm_frameNumber * speed / 1000.0);
  t *= (1.0 + percent);
  float alpha1 = smoothstep(t- percent, t, st.s) * step(-t, -st.s);
  alpha1 += alpha;
  material.diffuse = color.rgb;
  material.alpha = alpha1;
  return material;
}
`;
  const Td = {
      color: new l.Color(1, 0, 0, .7),
      alpha: .1,
      speed: 20,
      percent: .04,
      startTime: 0
    },
    Md = [Z("color")];
  class Ed extends Me {
    constructor(e) {
      super(oe(Md, e));
      P(this, "type", "LineFlowColor");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Td,
          source: Sd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var Dd = `
uniform vec4 color;
uniform float speed;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);
  float time = fract( czm_frameNumber  *  speed / 1000.0);
  vec2 st = materialInput.st;
  float scalar = smoothstep(0.0,1.0,time);
  material.diffuse = color.rgb * scalar;
  material.alpha = color.a * scalar ;
  return material;
}
`;
  const kd = {
      color: new l.Color(1, 0, 0, .7),
      speed: 10
    },
    zd = [Z("color")];
  class Id extends Me {
    constructor(e) {
      super(oe(zd, e));
      P(this, "type", "LineFlicker");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: kd,
          source: Dd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var Od = `uniform vec4 grassColor;
uniform vec4 dirtColor;
uniform float patchiness;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);

  vec2 st = materialInput.st;
  float noise1 = (czm_snoise(st * patchiness * 1.0)) * 1.0;
  float noise2 = (czm_snoise(st * patchiness * 2.0)) * 0.5;
  float noise3 = (czm_snoise(st * patchiness * 4.0)) * 0.25;
  float noise = sin(noise1 + noise2 + noise3) * 0.1;

  vec4 color = mix(grassColor, dirtColor, noise);

  //Make thatch patterns
  float verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;
  float horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;
  float stripeNoise = min(verticalNoise, horizontalNoise);

  color.rgb += stripeNoise;

  material.diffuse = color.rgb;
  material.alpha = color.a;

  return material;
}
`,
    Rd = `/**
 * @license
 * Description : Array and textureless GLSL 2D/3D/4D simplex
 *               noise functions.
 *      Author : Ian McEwan, Ashima Arts.
 *  Maintainer : ijm
 *     Lastmod : 20110822 (ijm)
 *     License : Copyright (C) 2011 Ashima Arts. All rights reserved.
 *               Distributed under the MIT License. See LICENSE file.
 *               https://github.com/ashima/webgl-noise
 */

vec4 _czm_mod289(vec4 x)
{
  return x - floor(x * (1.0 / 289.0)) * 289.0;
}

vec3 _czm_mod289(vec3 x)
{
    return x - floor(x * (1.0 / 289.0)) * 289.0;
}

vec2 _czm_mod289(vec2 x)
{
    return x - floor(x * (1.0 / 289.0)) * 289.0;
}

float _czm_mod289(float x)
{
    return x - floor(x * (1.0 / 289.0)) * 289.0;
}

vec4 _czm_permute(vec4 x)
{
    return _czm_mod289(((x*34.0)+1.0)*x);
}

vec3 _czm_permute(vec3 x)
{
    return _czm_mod289(((x*34.0)+1.0)*x);
}

float _czm_permute(float x)
{
    return _czm_mod289(((x*34.0)+1.0)*x);
}

vec4 _czm_taylorInvSqrt(vec4 r)
{
    return 1.79284291400159 - 0.85373472095314 * r;
}

float _czm_taylorInvSqrt(float r)
{
    return 1.79284291400159 - 0.85373472095314 * r;
}

vec4 _czm_grad4(float j, vec4 ip)
{
    const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);
    vec4 p,s;

    p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;
    p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
    s = vec4(lessThan(p, vec4(0.0)));
    p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;

    return p;
}

/**
 * DOC_TBA
 *
 * Implemented by Ian McEwan, Ashima Arts, and distributed under the MIT License.  {@link https://github.com/ashima/webgl-noise}
 *
 * @name czm_snoise
 * @glslFunction
 *
 * @see <a href="https://github.com/ashima/webgl-noise">https://github.com/ashima/webgl-noise</a>
 * @see Stefan Gustavson's paper <a href="http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf">Simplex noise demystified</a>
 */
float czm_snoise(vec2 v)
{
    const vec4 C = vec4(0.211324865405187,  // (3.0-sqrt(3.0))/6.0
                        0.366025403784439,  // 0.5*(sqrt(3.0)-1.0)
                       -0.577350269189626,  // -1.0 + 2.0 * C.x
                        0.024390243902439); // 1.0 / 41.0
    // First corner
    vec2 i  = floor(v + dot(v, C.yy) );
    vec2 x0 = v -   i + dot(i, C.xx);

    // Other corners
    vec2 i1;
    //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
    //i1.y = 1.0 - i1.x;
    i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
    // x0 = x0 - 0.0 + 0.0 * C.xx ;
    // x1 = x0 - i1 + 1.0 * C.xx ;
    // x2 = x0 - 1.0 + 2.0 * C.xx ;
    vec4 x12 = x0.xyxy + C.xxzz;
    x12.xy -= i1;

    // Permutations
    i = _czm_mod289(i); // Avoid truncation effects in permutation
    vec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));

    vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
    m = m*m ;
    m = m*m ;

    // Gradients: 41 points uniformly over a line, mapped onto a diamond.
    // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
    vec3 x = 2.0 * fract(p * C.www) - 1.0;
    vec3 h = abs(x) - 0.5;
    vec3 ox = floor(x + 0.5);
    vec3 a0 = x - ox;

    // Normalise gradients implicitly by scaling m
    // Approximation of: m *= inversesqrt( a0*a0 + h*h );
    m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );

    // Compute final noise value at P
    vec3 g;
    g.x  = a0.x  * x0.x  + h.x  * x0.y;
    g.yz = a0.yz * x12.xz + h.yz * x12.yw;
    return 130.0 * dot(m, g);
}

float czm_snoise(vec3 v)
{
    const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;
    const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);

    // First corner
    vec3 i  = floor(v + dot(v, C.yyy) );
    vec3 x0 =   v - i + dot(i, C.xxx) ;

    // Other corners
    vec3 g = step(x0.yzx, x0.xyz);
    vec3 l = 1.0 - g;
    vec3 i1 = min( g.xyz, l.zxy );
    vec3 i2 = max( g.xyz, l.zxy );

    //   x0 = x0 - 0.0 + 0.0 * C.xxx;
    //   x1 = x0 - i1  + 1.0 * C.xxx;
    //   x2 = x0 - i2  + 2.0 * C.xxx;
    //   x3 = x0 - 1.0 + 3.0 * C.xxx;
    vec3 x1 = x0 - i1 + C.xxx;
    vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y
    vec3 x3 = x0 - D.yyy;      // -1.0+3.0*C.x = -0.5 = -D.y

    // Permutations
    i = _czm_mod289(i);
    vec4 p = _czm_permute( _czm_permute( _czm_permute(
                i.z + vec4(0.0, i1.z, i2.z, 1.0 ))
              + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))
              + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));

    // Gradients: 7x7 points over a square, mapped onto an octahedron.
    // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
    float n_ = 0.142857142857; // 1.0/7.0
    vec3  ns = n_ * D.wyz - D.xzx;

    vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  //  mod(p,7*7)

    vec4 x_ = floor(j * ns.z);
    vec4 y_ = floor(j - 7.0 * x_ );    // mod(j,N)

    vec4 x = x_ *ns.x + ns.yyyy;
    vec4 y = y_ *ns.x + ns.yyyy;
    vec4 h = 1.0 - abs(x) - abs(y);

    vec4 b0 = vec4( x.xy, y.xy );
    vec4 b1 = vec4( x.zw, y.zw );

    //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
    //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
    vec4 s0 = floor(b0)*2.0 + 1.0;
    vec4 s1 = floor(b1)*2.0 + 1.0;
    vec4 sh = -step(h, vec4(0.0));

    vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
    vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;

    vec3 p0 = vec3(a0.xy,h.x);
    vec3 p1 = vec3(a0.zw,h.y);
    vec3 p2 = vec3(a1.xy,h.z);
    vec3 p3 = vec3(a1.zw,h.w);

    //Normalise gradients
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
    p0 *= norm.x;
    p1 *= norm.y;
    p2 *= norm.z;
    p3 *= norm.w;

    // Mix final noise value
    vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
    m = m * m;
    return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
                                dot(p2,x2), dot(p3,x3) ) );
}

float czm_snoise(vec4 v)
{
    const vec4  C = vec4( 0.138196601125011,  // (5 - sqrt(5))/20  G4
                          0.276393202250021,  // 2 * G4
                          0.414589803375032,  // 3 * G4
                         -0.447213595499958); // -1 + 4 * G4

    // (sqrt(5) - 1)/4 = F4, used once below
    #define F4 0.309016994374947451

    // First corner
    vec4 i  = floor(v + dot(v, vec4(F4)) );
    vec4 x0 = v -   i + dot(i, C.xxxx);

    // Other corners

    // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
    vec4 i0;
    vec3 isX = step( x0.yzw, x0.xxx );
    vec3 isYZ = step( x0.zww, x0.yyz );
    //  i0.x = dot( isX, vec3( 1.0 ) );
    i0.x = isX.x + isX.y + isX.z;
    i0.yzw = 1.0 - isX;
    //  i0.y += dot( isYZ.xy, vec2( 1.0 ) );
    i0.y += isYZ.x + isYZ.y;
    i0.zw += 1.0 - isYZ.xy;
    i0.z += isYZ.z;
    i0.w += 1.0 - isYZ.z;

    // i0 now contains the unique values 0,1,2,3 in each channel
    vec4 i3 = clamp( i0, 0.0, 1.0 );
    vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );
    vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );

    //  x0 = x0 - 0.0 + 0.0 * C.xxxx
    //  x1 = x0 - i1  + 1.0 * C.xxxx
    //  x2 = x0 - i2  + 2.0 * C.xxxx
    //  x3 = x0 - i3  + 3.0 * C.xxxx
    //  x4 = x0 - 1.0 + 4.0 * C.xxxx
    vec4 x1 = x0 - i1 + C.xxxx;
    vec4 x2 = x0 - i2 + C.yyyy;
    vec4 x3 = x0 - i3 + C.zzzz;
    vec4 x4 = x0 + C.wwww;

    // Permutations
    i = _czm_mod289(i);
    float j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);
    vec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (
               i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))
             + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))
             + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))
             + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));

    // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
    // 7*7*6 = 294, which is close to the ring size 17*17 = 289.
    vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;

    vec4 p0 = _czm_grad4(j0,   ip);
    vec4 p1 = _czm_grad4(j1.x, ip);
    vec4 p2 = _czm_grad4(j1.y, ip);
    vec4 p3 = _czm_grad4(j1.z, ip);
    vec4 p4 = _czm_grad4(j1.w, ip);

    // Normalise gradients
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
    p0 *= norm.x;
    p1 *= norm.y;
    p2 *= norm.z;
    p3 *= norm.w;
    p4 *= _czm_taylorInvSqrt(dot(p4,p4));

    // Mix contributions from the five corners
    vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);
    vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4)            ), 0.0);
    m0 = m0 * m0;
    m1 = m1 * m1;
    return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
                  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
}
`;
  const Bd = {
      grassColor: new l.Color(.25, .4, .1, 1),
      dirtColor: new l.Color(.1, .1, .1, 1),
      patchiness: 1.5
    },
    Ld = [Z("grassColor"), Z("dirtColor")];
  class Gd extends Me {
    constructor(e) {
      super(oe(Ld, e));
      P(this, "type", "PolyGrass");
      this._initMaterial()
    }
    _initMaterial() {
      l.ShaderSource._czmBuiltinsAndUniforms.czm_snoise || (l.ShaderSource._czmBuiltinsAndUniforms.czm_snoise = Rd), l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Bd,
          source: Od
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var Fd = `
uniform vec4 color;
uniform sampler2D image;
uniform float dashPattern;
const float maskLength = 64.0;

#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
  in float v_polylineAngle;
  in float v_width;
#else
  #define TEXTURE_FUNC texture2D
  varying float v_polylineAngle;
  varying float v_width;
#endif

mat2 rotate(float rad) {
    float c = cos(rad);
    float s = sin(rad);
    return mat2(
    c, s,
    -s, c
    );
}


czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;

    // Get the relative position within the dash from 0 to 1
    float dashPosition = fract(pos.x / (v_width * 4.0 * czm_pixelRatio));
    // Figure out the mask index.
    float maskIndex = floor(dashPosition * maskLength);
    // Test the bit mask.
    float maskTest = floor(dashPattern / pow(2.0, maskIndex));
    vec2 st = materialInput.st;
    vec4 fragColor = color;
    if (mod(maskTest, 2.0) < 1.0){
        vec4 c= TEXTURE_FUNC(image, vec2(dashPosition, st.t));
        if (c.w>=0.01){
            fragColor = vec4(1.0, 1.0, 1.0, 1.0);
        }
    }
    if (fragColor.a < 0.005) { // matches 0/255 and 1/255
        discard;
    }

    fragColor = czm_gammaCorrect(fragColor);
    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;
    return material;
}
`;
  const Hd = {
      color: new l.Color(1, 0, 1, 1),
      dashPattern: 255,
      image: ""
    },
    Nd = [Z("color")];
  class Bs extends Me {
    constructor(e) {
      super(oe(Nd, e));
      P(this, "type", "PolylineArrowLine");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Hd,
          source: Fd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  var Ud = `uniform vec4 bgColor;
uniform vec4 color;
uniform float speed;
uniform float startTime;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st = materialInput.st;
  float time = (czm_frameNumber - startTime) * speed / 1000.0;

  vec3 fragColor = color.rgb;

  if(time - st.s < 0.0) {
    material.alpha = 0.0;
  } else {
    material.alpha =  color.a;
  }
  material.diffuse = max(fragColor.rgb * material.alpha , fragColor.rgb);

  return material;
}
`;
  const Vd = {
      color: new l.Color(1, 1, 0, .7),
      speed: 5,
      startTime: 0
    },
    Wd = [Z("color")];
  class jd extends Me {
    constructor(e) {
      super(oe(Wd, e));
      P(this, "type", "LineTrailOnce");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Vd,
          source: Ud
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  const qd = [Z("color")];
  class Qd extends Me {
    constructor(e) {
      super(oe(qd, e));
      P(this, "type", "MaterialColor");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: "Color",
          uniforms: {
            color: {
              red: 1,
              green: 0,
              blue: 0,
              alpha: .5
            }
          },
          components: {
            diffuse: "color.rgb",
            alpha: "color.a"
          }
        }
      }))
    }
  }
  var Yd = `
uniform sampler2D image;
uniform float opacity;
uniform vec4 color;
uniform float globalAlpha;
uniform bool flipx;
uniform bool flipy;
uniform bool noWhite;
#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
#else
  #define TEXTURE_FUNC texture2D
#endif

czm_material czm_getMaterial(czm_materialInput materialInput) {
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 st =  fract(repeat * materialInput.st);
  if(flipx){
    st.x = st.x + (0.5 - st.x) * 2.0;
  }
  if(flipy){
    st.y = st.y + (0.5 - st.y) * 2.0;
  }

  vec4 imageMars3D;
  if(speed != 0.0)
    imageMars3D = TEXTURE_FUNC(image, vec2(fract(st.s + czm_frameNumber * speed / 1000.0), fract(st.t)));
  else
    imageMars3D = TEXTURE_FUNC(image, st);

  if(noWhite && imageMars3D.rgb == vec3(1.0)) {
    discard;
  }
  material.alpha = imageMars3D.a * opacity * color.a * globalAlpha;
  material.diffuse = imageMars3D.rgb * color.rgb;
  return material;
}
`;
  const Xd = {
      color: new l.Color(1, 1, 1, 1),
      image: "",
      opacity: 1,
      speed: 0,
      flipx: !1,
      flipy: !1,
      noWhite: !0,
      repeat: new l.Cartesian2(1, 1),
      globalAlpha: 1
    },
    Kd = [Z("color"), $("repeat", l.Cartesian2)];
  class Jd extends Me {
    constructor(e) {
      super(oe(Kd, e));
      P(this, "type", "LineFlicker");
      this._initMaterial()
    }
    _initMaterial() {
      l.Material[this.typeName] || (l.Material[this.typeName] = this.type, l.Material._materialCache.addMaterial(this.type, {
        fabric: {
          type: this.type,
          uniforms: Xd,
          source: Yd
        },
        translucent: function () {
          return !0
        }
      }))
    }
  }
  const $d = {
      [le.Checkerboard]: Nu,
      [le.CircleScan]: ju,
      [le.CircleWave]: Xu,
      [le.MaterialColor]: Qd,
      [le.Color]: Ju,
      [le.Grid]: Zu,
      [le.Image]: td,
      [le.Image2]: Jd,
      [le.LineFlow]: sd,
      [le.PolylineArrow]: ad,
      [le.PolylineDash]: cd,
      [le.PolylineGlow]: ud,
      [le.PolylineOutline]: pd,
      [le.Stripe]: md,
      [le.Water]: yd,
      [le.ODLine]: Cd,
      [le.LineTrail]: Pd,
      [le.LineTrailOnce]: jd,
      [le.LineFlowColor]: Ed,
      [le.LineFlicker]: Id,
      [le.PolyGrass]: Gd,
      [le.PolylineArrowLine]: Bs,
      [le.PolylineArrowLine]: Bs
    },
    Zd = i => {
      var n = i,
        {
          type: r
        } = n,
        e = re(n, ["type"]);
      const s = $d[r];
      if (s) return new s(e);
      console.error(`\u4E0D\u5B58\u5728\u7C7B\u578B\u4E3A${r}\u7684material`)
    },
    ep = r => {
      const e = r.opacity;
      U(e) && (r.color = (r.color || l.Color.WHITE).withAlpha(e))
    },
    tp = r => {
      U(r.text) && (r.text = be(r.text, e => e == null ? void 0 : e.replace(new RegExp("<br/>", "gm"), `
`)), Xt([r.fontStyle, r.fontWeight, r.fontSize, r.fontFamily, r.lineHeight]) && (r.font = `${r.fontStyle||"normal"} small-caps ${r.fontWeight||"normal"} ${r.fontSize||"30"}px ${U(r.lineHeight)?`/${r.lineHeight}`:""} ${r.fontFamily||"\u9ED1\u4F53"}`))
    },
    ip = r => {
      const e = r.color || r.fillColor;
      U(e) && (r.fillColor = be(e, rt), r.fill = !0)
    },
    Fe = r => {
      const e = r.material || r.color;
      if (!ce(e)) {
        if (e instanceof l.Color) {
          r.material = e;
          return
        }
        if (Re(e) || Oe(e)) {
          r.material = be(e, rt);
          return
        }
        ge(e) && (r.material = Zd(e))
      }
    },
    dt = r => {
      U(r.outlineWidth) && (r.style = be(r.outlineWidth, e => e ? l.LabelStyle.FILL_AND_OUTLINE : l.LabelStyle.FILL, {
        forceFormat: !0
      }))
    },
    He = r => {
      const e = r.outlineColor || r.borderColor;
      U(e) && (r.outlineColor = be(e, rt))
    },
    rp = r => {
      const e = r.backgroundColor;
      U(e) && (r.showBackground = !0, r.backgroundColor = be(e, rt))
    },
    zr = r => {
      const e = r.clampToTerrain;
      U(e) && (r.heightReference = be(e, i => i ? l.HeightReference.CLAMP_TO_GROUND : l.HeightReference.NONE))
    },
    Ir = r => {
      const e = r.clampToTerrain;
      U(e) && (r.classificationType = be(e, i => i ? l.ClassificationType.TERRAIN : l.ClassificationType.CESIUM_3D_TILE), e && (r.clampToGround = !0))
    },
    Or = r => {
      const e = r.visibleDepth;
      U(e) && (r.disableDepthTestDistance = be(e, i => i ? 0 : Number.POSITIVE_INFINITY))
    },
    np = r => {
      const e = r.modelMatrix;
      U(e) && (r.modelMatrix = be(e, i => Ie(i) ? l.Matrix4.fromArray(i) : i))
    },
    nt = r => {
      U(r.outlineWidth) && (r.outline = be(r.outlineWidth, e => !!e, {
        forceFormat: !0
      }))
    },
    Rr = r => {
      const e = r.clampToGround;
      U(e) && (r.height = e ? void 0 : r.height, r.extrudedHeight = e ? void 0 : r.extrudedHeight)
    },
    Br = r => {
      ce(r.extrudedHeight) && r.lineHelper && (r.outline = !1)
    },
    sp = {
      billboard: {
        adaptors: [Ge("url", "image"), $("alignedAxis", l.Cartesian3), $("pixelOffset", l.Cartesian2), $("eyeOffset", l.Cartesian3), ee("horizontalOrigin", l.HorizontalOrigin), ee("verticalOrigin", l.VerticalOrigin), Z("color"), $("scaleByDistance", l.NearFarScalar), $("translucencyByDistance", l.NearFarScalar), $("pixelOffsetScaleByDistance", l.NearFarScalar), $("distanceDisplayCondition", l.DistanceDisplayCondition), zr, Or, ee("heightReference", l.HeightReference), _e(["color"])],
        defaultStyle: {
          horizontalOrigin: l.HorizontalOrigin.CENTER,
          verticalOrigin: l.VerticalOrigin.BOTTOM,
          isLabelInImage: !1
        }
      },
      label: {
        adaptors: [tp, ip, rp, $("backgroundPadding", l.Cartesian2), $("pixelOffset", l.Cartesian2), $("eyeOffset", l.Cartesian3), ee("horizontalOrigin", l.HorizontalOrigin), ee("verticalOrigin", l.VerticalOrigin), He, Ge("outlineWidth", "borderWidth"), $("translucencyByDistance", l.NearFarScalar), $("pixelOffsetScaleByDistance", l.NearFarScalar), $("scaleByDistance", l.NearFarScalar), $("distanceDisplayCondition", l.DistanceDisplayCondition), dt, Or, zr, ee("heightReference", l.HeightReference), _e(["fillColor", "outlineColor", "backgroundColor"])],
        defaultStyle: {}
      },
      point: {
        adaptors: [Z("color"), He, Ge("outlineWidth", "borderWidth"), $("scaleByDistance", l.NearFarScalar), $("translucencyByDistance", l.NearFarScalar), $("distanceDisplayCondition", l.DistanceDisplayCondition), Or, zr, ee("heightReference", l.HeightReference), _e(["color", "outlineColor"])],
        defaultStyle: {
          pixelSize: 10
        }
      },
      divPoint: {
        adaptors: [ee("verticalOrigin", l.VerticalOrigin), ee("horizontalOrigin", l.HorizontalOrigin), $("distanceDisplayCondition", l.DistanceDisplayCondition), $("scaleByDistance", l.NearFarScalar), $("pixelOffset", l.Cartesian2)],
        defaultStyle: {
          horizontalOrigin: l.HorizontalOrigin.CENTER,
          verticalOrigin: l.VerticalOrigin.BOTTOM,
          scale: 1
        }
      },
      geoJson: {
        adaptors: [Ge("url", "uri")],
        defaultStyle: {}
      },
      group: {
        adaptors: [],
        defaultStyle: {}
      },
      polyline: {
        adaptors: [Fe, $("distanceDisplayCondition", l.DistanceDisplayCondition), ee("arcType", l.ArcType), Z("depthFailMaterial"), _e(["material"]), r => {
          const e = r.clampToTerrain;
          U(e) && (r.classificationType = e ? l.ClassificationType.TERRAIN : l.ClassificationType.CESIUM_3D_TILE, e && (r.clampToGround = !0))
        }, ee("classificationType", l.ClassificationType)],
        defaultStyle: {}
      },
      polygon: {
        adaptors: [ee("extrudedHeightReference", l.HeightReference), Fe, He, Z("outlineColor"), Ge("outlineWidth", "borderWidth"), ee("arcType", l.ArcType), $("distanceDisplayCondition", l.DistanceDisplayCondition), nt, Br, Ir, r => {
          const e = r.clampToGround;
          U(e) && (r.perPositionHeight = !e, r.height = e ? void 0 : r.height, r.extrudedHeight = e ? void 0 : r.extrudedHeight), U(r.height) && (r.perPositionHeight = void 0)
        }, ee("heightReference", l.HeightReference), _e(["material", "outlineColor"]), ee("classificationType", l.ClassificationType)],
        defaultStyle: {
          perPositionHeight: !0,
          outlineWidth: 0,
          lineHelper: !0
        }
      },
      ellipse: {
        adaptors: [r => {
          const e = r.semiAxis;
          U(e) && (r.semiMinorAxis = e, r.semiMajorAxis = e)
        }, ee("extrudedHeightReference", l.HeightReference), Fe, He, Ge("outlineWidth", "borderWidth"), ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), Ir, Rr, ee("classificationType", l.ClassificationType), ee("heightReference", l.HeightReference), _e(["material", "outlineColor"]), nt, Br],
        defaultStyle: {
          height: 0,
          outlineWidth: 0
        }
      },
      box: {
        adaptors: [$("dimensions", l.Cartesian3), ee("heightReference", l.HeightReference), nt, Fe, He, ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"])],
        defaultStyle: {}
      },
      corridor: {
        adaptors: [ee("heightReference", l.HeightReference), ee("extrudedHeightReference", l.extrudedHeightReference), ee("cornerType", l.CornerType), Fe, He, dt, nt, ee("shadows", l.ShadowMode), ee("arcType", l.ArcType), ee("classificationType", l.ClassificationType), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"]), Ir, Rr],
        defaultStyle: {
          height: 0
        }
      },
      cylinder: {
        adaptors: [ee("heightReference", l.HeightReference), Fe, He, dt, nt, ee("shadows", l.ShadowMode), ee("arcType", l.ArcType), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"])],
        defaultStyle: {}
      },
      model: {
        adaptors: [Ge("uri", "url"), ee("heightReference", l.HeightReference), Z("silhouetteColor"), Z("color"), ee("colorBlendMode", l.ColorBlendMode), $("imageBasedLightingFactor", l.Cartesian2), Z("lightColor"), $("distanceDisplayCondition", l.DistanceDisplayCondition), ee("shadows", l.ShadowMode), _e(["color"])],
        defaultStyle: {}
      },
      path: {
        adaptors: [Fe, $("distanceDisplayCondition", l.DistanceDisplayCondition), He, dt, ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"])],
        defaultStyle: {
          leadTime: 0,
          trailTime: 1 / 0
        }
      },
      plane: {
        adaptors: [Fe, $("dimensions", l.Cartesian2), Z("outlineColor"), nt, _e(["material", "outlineColor"]), r => {
          if (Re(r.plane)) {
            const e = {
              x: l.Cartesian3.UNIT_X,
              y: l.Cartesian3.UNIT_Y,
              z: l.Cartesian3.UNIT_Z
            };
            r.plane = new l.Plane(e[r.plane], 0)
          }
        }],
        defaultStyle: {
          plane: "z"
        }
      },
      polylineVolume: {
        adaptors: [r => {
          !r.shape || (r.shape = r.shape.map(e => Ie(e) ? new l.Cartesian2(...e) : e))
        }, ee("cornerType", l.CornerType), Fe, He, dt, ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"])],
        defaultStyle: {}
      },
      rectangle: {
        adaptors: [ee("heightReference", l.HeightReference), ee("extrudedHeightReference", l.extrudedHeightReference), Fe, He, dt, nt, Br, ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), ee("classificationType", l.ClassificationType), _e(["material", "outlineColor"]), Rr],
        defaultStyle: {
          height: 0,
          outlineWidth: 0
        }
      },
      roamLine: {
        adaptors: [],
        defaultStyle: {}
      },
      tileset: {
        adaptors: [$("lightColor", l.Cartesian3), Ge("url", "uri"), np, Z("color"), ep],
        defaultStyle: {}
      },
      wall: {
        adaptors: [Fe, He, dt, ee("shadows", l.ShadowMode), $("distanceDisplayCondition", l.DistanceDisplayCondition), _e(["material", "outlineColor"]), nt],
        defaultStyle: {
          diffHeight: 10
        }
      }
    },
    op = [Ge("heading", "rotateX"), Ge("pitch", "rotateY"), Ge("roll", "rotateZ")],
    Ae = function (r, e, {
      merge: i = !0,
      supportProperty: n = !1
    } = {}) {
      if (!r || !e) return r;
      const s = sp[e];
      if (!s) return r;
      const {
        adaptors: o,
        defaultStyle: a
      } = s;
      return i && (r = lp([a, r])), n || Object.keys(r).forEach(c => {
        Oe(r[c]) && (r[c] = r[c]())
      }), oe(op.concat(o), r)
    };
  class st extends it {
    constructor(e = {}) {
      super();
      P(this, "isGraphic", !0);
      P(this, "graphicStyle", {});
      P(this, "_hasEdit", !1);
      const u = e,
        {
          id: i = Kt(),
          visible: n = !0,
          forbidEvent: s = !1,
          style: o = {},
          attr: a = {},
          hasEdit: c = !1
        } = u,
        h = re(u, ["id", "visible", "forbidEvent", "style", "attr", "hasEdit"]);
      this.id = i, this.visible = n, this.forbidEvent = s, this.hasEdit = c, this.options = j({
        style: o,
        attr: a
      }, h)
    }
    appendTo(e) {
      if (e === this) return;
      let i = this.state;
      this.state = me.REMOVED, this._parent && (this._parent.primitive.destroyPrimitives = !1, this._parent.removeGraphic(this), this._parent.primitive.destroyPrimitives = !0, this._parent = null), e.addGraphic(this), this.state = i
    }
    get style() {
      return this.options.style
    }
    get attr() {
      return this.options.attr || {}
    }
    set attr(e) {
      this.options.attr = e || {}
    }
    setAttr(e) {
      U(e) && (this.options.attr = ne(this.attr, e))
    }
    _addedHook() {
      super._addedHook(), this.entity && (this.entity._parentGraphic = this), this.primitive && (this.primitive._parentGraphic = this), this.hasEdit && this._map.drawTool, this.fire("addToMap", this._map)
    }
    show() {
      this.entity && (this.entity.show = !0), this.primitive && (this.primitive.show = !0), this.dataSource && (this.dataSource.show = !0), this.visible = !0
    }
    hide() {
      this.entity && (this.entity.show = !1), this.primitive && (this.primitive.show = !1), this.dataSource && (this.dataSource.show = !1), this.visible = !1
    }
    addTo(e) {
      return e.addGraphic(this), this
    }
    destroy() {
      super.destroy(), this._parent && (this._parent.removeGraphic(this), this._parent = null), this._map = null
    }
    setOptions({
      position: e,
      positions: i,
      attr: n,
      style: s,
      visible: o,
      hasEdit: a
    } = {}) {
      return U(a) && (this.hasEdit = a), U(o) && (o ? this.show() : this.hide()), U(n) && this.setAttr(n), U(s) && this.setStyle(s), U(e) && (this.position = e), U(i) && (this.positions = i), this
    }
    setStyle(e = {}, i) {
      var u, d;
      if (!i) {
        console.error("type \u4E0D\u80FD\u4E3A\u7A7A");
        return
      }
      this.options.style = zt(this.style, e);
      const n = Ae(this.options.style, i, {
        supportProperty: !this.primitive
      });
      this.graphicStyle = ne(this.graphicStyle, n);
      const h = n,
        {
          label: s,
          addHeight: o,
          setHeight: a
        } = h,
        c = re(h, ["label", "addHeight", "setHeight"]);
      s && (s.clampToGround = (u = s.clampToGround) != null ? u : c.clampToGround, s.clampToTerrain = (d = s.clampToTerrain) != null ? d : c.clampToTerrain), [{
        type: "label",
        style: Ae(s, "label", {
          supportProperty: !this.primitive
        })
      }, {
        type: i,
        style: c
      }].forEach(({
        type: p,
        style: f
      }) => {
        !f || (this.entity && (this.entity[p] ? Object.entries(f).forEach(([m, g]) => {
          this.entity[p][m] = g
        }) : this.entity[p] = f), this.primitive && i === this.type && Object.entries(f).forEach(([m, g]) => {
          this.primitive[m] = g
        }))
      }), G.Billboard === this.type && this.graphicStyle.isLabelInImage && e.label && this._map && (this._map.imageBuilder.fromText(this.style.image || this.style.url, Ae(this.style.label, G.Label), this.graphicStyle).then(p => {
        this.entity[G.Billboard].image = p
      }), this.entity.label.show = !1), this.fire("update:style", this.style)
    }
    flyTo(e) {
      return this._map && this._map.flyToGraphic(this, e), this
    }
    edit(e = {}) {
      if (!!this._map) return this._map.drawTool.edit(this, j({
        isRestorePositions: !0
      }, e))
    }
    get hasEdit() {
      return this._hasEdit
    }
    set hasEdit(e) {
      e && this._map && this._map.drawTool, this._hasEdit = e
    }
    _updateHelperLineStyle() {
      ce(this.graphicStyle.extrudedHeight) ? (this.entity.polyline.show = !0, this.entity.polyline.width = this.graphicStyle.outlineWidth, this.style.outlineColor && (this.entity.polyline.material = l.Color.fromCssColorString(this.style.outlineColor)), this.entity.polyline.clampToGround = this.style.clampToGround, this.entity.polyline.disableDepthTestDistance = this.style.disableDepthTestDistance) : this.entity.polyline.show = !1
    }
    toData() {
      if (this.isPointGraphic) return new R(this.point).toLatLng();
      if (this.isPointsGraphic) return this.points.map(e => new R(e).toLatLng())
    }
    toJSON() {
      const e = {
        type: this.type,
        attr: this.attr,
        style: this.style,
        clip: this.options.clip,
        visible: this.visible
      };
      return this.isPointGraphic && (e.position = this.point && new R(this.point).toLatLng()), this.isPointsGraphic && (e.positions = this.points.map(i => new R(i).toLatLng())), [G.Tileset, G.Model].includes(this.type) && (e.rotate = this.hpr), e
    }
    get isRealVisible() {
      let e = this,
        i = !0;
      for (; e;) !ce(e.visible) && !e.visible && (i = !1), e = e._parent;
      return i
    }
  }
  class Dt extends vr {
    _createObserver() {
      return kr()
    }
  }
  class Ls extends Dt {
    constructor(e, i = {}) {
      super();
      P(this, "state", "ready");
      P(this, "currentIndex", -1);
      P(this, "positions", []);
      this.options = i, this._map = e, this.clock = this._map.viewer.clock, this._init()
    }
    _init() {
      const e = this.clock;
      e.shouldAnimate = !1, this.startTime = e.currentTime.clone(), this.property = new l.SampledPositionProperty, e.startTime = this.startTime.clone(), e.clockRange = this.options.loop ? l.ClockRange.LOOP_STOP : l.ClockRange.CLAMPED, e.onTick.addEventListener(this.onTick, this), e.onStop.addEventListener(this.onStop, this), this.options.positions && this.options.positions.forEach(i => {
        this.add(i)
      })
    }
    get orientation() {
      return new l.VelocityOrientationProperty(this.property)
    }
    destroy() {
      this.clock.onTick.removeEventListener(this.onTick, this), this.clock.onStop.removeEventListener(this.onStop, this), super.destroy()
    }
    onStop() {
      const e = this.clock;
      if (!e.shouldAnimate) return;
      e.clockRange !== l.ClockRange.LOOP_STOP && (this.clock.shouldAnimate = !1);
      const i = this.positions.length;
      this.currentIndex = i - 1, this.state = "stop", this.fire("endItem", {
        position: this.positions[this.currentIndex],
        index: this.currentIndex
      }), this.fire("end")
    }
    onTick() {
      const e = this.clock;
      if (!e.shouldAnimate) return;
      const i = e.currentTime.clone(),
        n = this.property._property._times.findIndex(s => l.JulianDate.greaterThanOrEquals(s, i));
      this.currentIndex !== n - 1 && (this.currentIndex = n - 1, this.fire("endItem", {
        position: this.positions[this.currentIndex],
        index: this.currentIndex
      })), this.fire("update", {
        point: this.currentValue,
        index: this.currentIndex,
        positions: this.positions
      })
    }
    get currentValue() {
      return this.property.getValue(this.clock.currentTime)
    }
    start() {
      if (!this.positions.length) return;
      const e = this.clock;
      e.stopTime = this.lastTime.clone(), e.currentTime = this.startTime.clone(), e.shouldAnimate = !0, this.fire("start"), this.state = "pending"
    }
    reset() {
      this.state = "ready";
      const e = this.clock;
      e.stopTime = this.lastTime.clone(), e.currentTime = this.startTime.clone(), e.shouldAnimate = !1
    }
    proceed() {
      const e = this.clock;
      e.stopTime = this.lastTime.clone(), e.shouldAnimate = !0, this.state = "pending"
    }
    pause() {
      this.clock.shouldAnimate = !1, this.state = "pause"
    }
    get lastTime() {
      var e;
      return (e = this.positions[this.positions.length - 1]) == null ? void 0 : e.sampleTime
    }
    get lastPoint() {
      var e;
      return (e = this.positions[this.positions.length - 1]) == null ? void 0 : e.getValue()
    }
    add(e) {
      if (!e) return;
      e.getValue = e.getValue || function () {
        return new R(this)
      };
      const i = e.getValue();
      e.sampleValue = i;
      const n = this.property,
        s = this.startTime;
      let o = this.lastTime,
        a = null;
      o || (a = l.JulianDate.addSeconds(s, 0, new l.JulianDate)), !a && e.time && (a = l.JulianDate.addSeconds(s, l.JulianDate.secondsDifference(l.JulianDate.fromDate(e.time), l.JulianDate.fromDate(this.startTime))));
      const c = e.speed || this.options.speed;
      if (!a && c && !e.duration) {
        const d = l.Cartesian3.distance(i, this.lastPoint) / (c / 3.6);
        a = l.JulianDate.addSeconds(o, d, new l.JulianDate)
      }
      const h = e.duration || this.options.duration || 2e3;
      !a && h && (a = l.JulianDate.addSeconds(o, h / 1e3, new l.JulianDate)), i && n.addSample(a, i), this.positions.push(se(j({}, e), {
        sampleTime: a
      }))
    }
    refreshPosition() {
      if (!this.property) return;
      let e;
      this.positions.forEach(i => {
        const n = i.getValue();
        i.sampleValue = n, e = n || e, e ? this.property.addSample(i.sampleTime, e) : this.property.removeSample(i.sampleTime)
      })
    }
  }
  const Pe = {
    pixel: 120,
    xAisColor: l.Color.RED,
    yAisColor: l.Color.GREEN,
    zAisColor: l.Color.BLUE,
    activeColor: l.Color.YELLOW
  };
  class Lr extends Dt {
    constructor({
      map: e,
      graphic: i,
      log: n = !1
    }) {
      super();
      P(this, "dashScaleModelMatrix", l.Matrix4.IDENTITY.clone());
      P(this, "scaleModelMatrix", l.Matrix4.IDENTITY.clone());
      P(this, "moveModelMatrix", l.Matrix4.IDENTITY.clone());
      this._map = e, this._graphic = i, this._primitive = new l.PrimitiveCollection, e.viewer.scene.primitives.add(this._primitive), this._basePxMeter = this._getPxMeter(), this._originPoint = this._graphic.point, this._init();
      let s = null;
      this._dragging = !1, this.effectFuncs = [i.on("update:position", () => {
        this._xAxisActive || this._yAxisActive || this._zAxisActive || (this.moveModelMatrix = l.Matrix4.fromTranslation(l.Cartesian3.subtract(i.point, this._originPoint, new l.Cartesian3)))
      }), e.on("preRender", () => {
        const o = this._getPxMeter();
        if (o === s) return;
        s = o;
        const a = o / this._basePxMeter;
        this.scaleModelMatrix = this._scale({
          x: a,
          y: a,
          z: a
        }), this.update()
      }), e.on("mousemove", o => {
        if (this._dragging || !this._xAxis._material) return;
        this._xAxisActive = !1, this._yAxisActive = !1, this._zAxisActive = !1;
        const a = o.features;
        if (a.find(c => c.primitive === this._xyPlane)) {
          const h = o.intersection(this._graphic.point).toMercator(),
            u = new R(this._graphic.point).toMercator(),
            d = h.x - u.x,
            p = h.y - u.y,
            f = this._getPxMeter(),
            m = d / f / Pe.pixel,
            g = p / f / Pe.pixel;
          m >= .05 && (this._xAxisActive = !0), g >= .05 && (this._yAxisActive = !0), this._xAxisActive && this._yAxisActive && (this.dashScaleModelMatrix = this._scale({
            x: m,
            y: g,
            z: 1
          }), this.update())
        }
        a.find(c => c.primitive === this._xAxis) && (this._xAxisActive = !0), a.find(c => c.primitive === this._yAxis) && (this._yAxisActive = !0), a.find(c => c.primitive === this._zAxis) && (this._zAxisActive = !0), this._dashLine.show = !!(this._xAxisActive && this._yAxisActive), this._xAxis._material.uniforms.color = this._xAxisActive ? Pe.activeColor : Pe.xAisColor, this._yAxis._material.uniforms.color = this._yAxisActive ? Pe.activeColor : Pe.yAisColor, this._zAxis._material.uniforms.color = this._zAxisActive ? Pe.activeColor : Pe.zAisColor
      }), e.on("click", o => {
        if (this._dragging || !(this._xAxisActive || this._yAxisActive || this._zAxisActive)) return;
        let a, c;
        if (this._zAxisActive) {
          let f = l.Cartesian3.subtract(this._graphic.point, e.camera.positionWC, new l.Cartesian3);
          f = l.Cartesian3.normalize(f, new l.Cartesian3);
          let m = l.Cartesian3.projectVector(f, l.Matrix4.multiplyByPoint(l.Transforms.eastNorthUpToFixedFrame(this._graphic.point), l.Cartesian3.UNIT_Z, new l.Cartesian3), new l.Cartesian3);
          const g = l.Cartesian3.subtract(m, f, new l.Cartesian3);
          c = l.Plane.fromPointNormal(this._graphic.point, l.Cartesian3.normalize(g, new l.Cartesian3)), a = o.intersection(c)
        } else a = o.intersection(this._graphic.point), c = l.Plane.fromPointNormal(a, l.Cartesian3.normalize(a, new l.Cartesian3));
        if (!a) return;
        const h = this.moveModelMatrix.clone();
        this._dragging = !0, this._startPoint = a;
        const u = l.Transforms.eastNorthUpToFixedFrame(a),
          d = l.Matrix4.inverse(u, new l.Matrix4);
        this.fire("drag-start"), this._targetPoint = this._graphic.point, this._graphic.primitive || (this._graphic.position = new l.CallbackProperty(() => this._targetPoint, !1));
        const p = this._map.on("mousemove", f => {
          const m = f.intersection(c);
          if (!m) return;
          const g = l.Matrix4.multiplyByPoint(d, m, new l.Cartesian3);
          this._xAxisActive || (g.x = 0), this._yAxisActive || (g.y = 0), this._zAxisActive || (g.z = 0);
          const y = l.Matrix4.multiplyByPoint(u, g, new l.Cartesian3);
          this.moveModelMatrix = l.Matrix4.multiply(h, l.Matrix4.fromTranslation(l.Cartesian3.subtract(y, a, new l.Cartesian3)), new l.Matrix4), this.update(), this.updatePosition(), this._updateXYZBoxPrimitive(), this.fire("drag")
        });
        this._map.once("click", () => {
          this.fire("drag-end"), this._graphic.position = this._targetPoint, this._dragging = !1, this._startPoint = null, this._updateXYZBoxPrimitive(), this._map.viewer.render(), this._map.scene.requestRender(), p()
        })
      })], this.log = n
    }
    get modelMatrix() {
      return l.Matrix4.multiply(this.moveModelMatrix, this.scaleModelMatrix, new l.Matrix4)
    }
    _updateXYZBoxPrimitive() {
      if (this._xyzBox && this._primitive.remove(this._xyzBox), !this._startPoint) return;
      const e = [this._startPoint, l.Matrix4.multiplyByPoint(this.modelMatrix, this._originPoint, new l.Cartesian3)];
      let i;
      if (this._xAxisActive && this._yAxisActive) {
        const n = l.Rectangle.fromCartesianArray(e),
          s = e[0].height;
        i = [new R(l.Rectangle.northwest(n)).setHeight(s), new R(l.Rectangle.southwest(n)).setHeight(s), new R(l.Rectangle.southeast(n)).setHeight(s), new R(l.Rectangle.northeast(n)).setHeight(s), new R(l.Rectangle.northwest(n)).setHeight(s)]
      } else i = e;
      this._xyzBox = new l.Primitive({
        asynchronous: !1,
        allowPicking: !1,
        geometryInstances: new l.GeometryInstance({
          geometry: new l.PolylineGeometry({
            positions: i,
            width: 2,
            vertexFormat: l.PolylineMaterialAppearance.VERTEX_FORMAT
          })
        }),
        appearance: new l.PolylineMaterialAppearance({
          material: new l.Material({
            fabric: {
              type: "PolylineDash",
              uniforms: {
                color: Pe.activeColor
              }
            }
          }),
          renderState: {
            depthTest: {
              enabled: !1
            }
          }
        })
      }), this._primitive.add(this._xyzBox)
    }
    updatePosition() {
      let e = l.Matrix4.multiplyByPoint(this.moveModelMatrix, this._originPoint, new l.Cartesian3);
      e && !this._zAxisActive && (e = new R(e, {
        setHeight: this._graphic.point.height
      })), this.log && console.log(e), this._targetPoint = e, this._graphic.primitive && (this._graphic.position = this._targetPoint)
    }
    _init() {
      const e = this._originPoint,
        i = e.toMercator(),
        n = this._basePxMeter * Pe.pixel,
        s = i.clone(),
        o = i.clone(),
        a = i.clone();
      s.x += n, o.y += n, a.z += n;
      const c = R.fromMercator(s),
        h = R.fromMercator(o),
        u = R.fromMercator(a);
      this._xAxis = this._addAxisPrimitive([e, c], {
        color: Pe.xAisColor
      }), this._yAxis = this._addAxisPrimitive([e, h], {
        color: Pe.yAisColor
      }), this._zAxis = this._addAxisPrimitive([e, u], {
        color: Pe.zAisColor
      }), this._xyPlane = this._addXYPlanePrimitive([e, c, h]), this._dashLine = this._addDashPrimitive([e, c, h]), this._dashLine.show = !1
    }
    _addDashPrimitive(e) {
      const i = l.Rectangle.fromCartesianArray(e),
        n = e[0].height,
        s = new l.Primitive({
          allowPicking: !1,
          geometryInstances: new l.GeometryInstance({
            geometry: new l.PolylineGeometry({
              positions: [new R(l.Rectangle.southeast(i)).setHeight(n), new R(l.Rectangle.northeast(i)).setHeight(n), new R(l.Rectangle.northwest(i)).setHeight(n)],
              width: 2,
              vertexFormat: l.PolylineMaterialAppearance.VERTEX_FORMAT
            })
          }),
          appearance: new l.PolylineMaterialAppearance({
            material: new l.Material({
              fabric: {
                type: "PolylineDash",
                uniforms: {
                  color: Pe.activeColor
                }
              }
            }),
            renderState: {
              depthTest: {
                enabled: !1
              }
            }
          })
        });
      return this._primitive.add(s), s
    }
    _addXYPlanePrimitive(e) {
      const i = new l.Primitive({
        geometryInstances: new l.GeometryInstance({
          geometry: new l.RectangleGeometry({
            rectangle: l.Rectangle.fromCartesianArray(e),
            height: e[0].height
          }),
          attributes: {
            color: new l.ColorGeometryInstanceAttribute(0, 0, 1, .01)
          }
        }),
        appearance: new l.PerInstanceColorAppearance({
          translucent: !0,
          renderState: {
            depthTest: {
              enabled: !1
            }
          }
        })
      });
      return this._primitive.add(i, 0), i
    }
    _addAxisPrimitive(e, {
      color: i
    }) {
      const n = new l.Primitive({
        asynchronous: !0,
        geometryInstances: new l.GeometryInstance({
          geometry: new l.PolylineGeometry({
            positions: e,
            width: 20,
            vertexFormat: l.PolylineMaterialAppearance.VERTEX_FORMAT
          })
        }),
        appearance: new l.PolylineMaterialAppearance({
          material: new l.Material({
            fabric: {
              type: "PolylineArrow",
              uniforms: {
                color: i
              }
            }
          }),
          renderState: {
            depthTest: {
              enabled: !1
            }
          }
        })
      });
      return this._primitive.add(n, 0), n
    }
    _getPxMeter() {
      return this._map.getPxMeter(this._graphic.point)
    }
    _scale({
      x: e,
      y: i,
      z: n
    }) {
      const s = l.Transforms.eastNorthUpToFixedFrame(this._originPoint),
        o = l.Matrix4.multiplyByScale(s, new l.Cartesian3(e, i, n), new l.Matrix4);
      return l.Matrix4.multiply(o, l.Matrix4.inverse(s, new l.Matrix4), new l.Matrix4)
    }
    update() {
      const e = this.modelMatrix;
      [this._xAxis, this._yAxis, this._zAxis, this._xyPlane].forEach(n => {
        n && (n.modelMatrix = e)
      });
      const i = l.Matrix4.multiply(this.dashScaleModelMatrix, this.scaleModelMatrix, new l.Matrix4);
      this._dashLine.modelMatrix = l.Matrix4.multiply(this.moveModelMatrix, i, new l.Matrix4)
    }
    destroy() {
      super.destroy(), this.effectFuncs && (this.effectFuncs.forEach(e => e()), this.effectFuncs = null), this._primitive && this._map && (this._map.viewer.scene.primitives.remove(this._primitive), this._primitive = null), this._xAxis = null, this._yAxis = null, this._zAxis = null, this._xyPlane = null, this._map = null, this._graphic = null
    }
  }
  class Ne extends st {
    constructor(e) {
      super(e);
      P(this, "isPointGraphic", !0);
      P(this, "_position", null);
      P(this, "_positionEdit", null);
      if (Oe(this.options.position)) {
        const n = this.options.position;
        this.options.position = this.options.primitive ? n() : new l.CallbackProperty(() => new R(n()), !1)
      }
      const {
        position: i
      } = this.options;
      this._position = i
    }
    _addedHook() {
      super._addedHook();
      const e = this.options.rotate;
      e && this.rotate(e), this.setStyle(this.style);
      const {
        clampToGround: i,
        addHeight: n,
        setHeight: s
      } = this.style;
      Vs([i, n, s]) && this._updatePosition()
    }
    _updatePosition() {
      if (!this.options.position || this.options.position.getValue) this._position = this.options.position;
      else {
        if (this.style.clampToGround) {
          this.clampToGround();
          return
        }
        const {
          setHeight: e,
          addHeight: i
        } = this.style;
        this._position = new R(this.options.position, {
          addHeight: i,
          setHeight: e
        })
      }
      this.entity && (this.entity.position = this.position), this.primitive && (this.primitive.position = this.position)
    }
    set position(e) {
      var i;
      if (e instanceof Function) {
        let n = e;
        e = new l.CallbackProperty(() => n(), !1)
      }
      this.options.position = e, this.style.clampToGround && (this.entity && (this.entity.position = e), this.primitive && (this.primitive.position = e)), (i = this._updatePosition) == null || i.call(this, !0), this.fire("update:position", this.position)
    }
    get position() {
      return this._position
    }
    get center() {
      return this.point
    }
    get point() {
      const e = this.position;
      if (e && e.getValue) {
        if (!this._map) return null;
        const i = e.getValue(this._map.viewer.clock.currentTime);
        return i && new R(i)
      }
      return e && new R(e)
    }
    get points() {
      return [this.point]
    }
    set orientation(e) {
      this.entity && (this.entity.orientation = e)
    }
    get orientation() {
      var e;
      return (e = this.entity) == null ? void 0 : e.orientation
    }
    addDynamicPosition(e) {
      this._map || console.error("\u5FC5\u987B\u6DFB\u52A0\u5230map\u4E2D\u540E \u624D\u80FD\u8C03\u7528\u6B64\u65B9\u6CD5"), this._ani ? (this._ani.add(e), this._ani.proceed()) : (this._ani = new Ls(this._map, {
        positions: [this.position]
      }), this.once("destroy", () => {
        this._ani.destroy()
      }), this._ani.add(e), this._ani.start()), this.position = this._ani.property, this.orientation = this._ani.orientation
    }
    rotate(e) {
      var a, c, h, u, d, p;
      const i = this.hpr,
        n = (c = (a = e.roll) != null ? a : e.rotateX) != null ? c : i.roll,
        s = (u = (h = e.pitch) != null ? h : e.rotateY) != null ? u : i.pitch,
        o = (p = (d = e.heading) != null ? d : e.rotateZ) != null ? p : i.heading;
      this.orientation = l.Transforms.headingPitchRollQuaternion(this.point, new l.HeadingPitchRoll(Math.PI * (o / 180), Math.PI * (s / 180), Math.PI * (n / 180))), this.fire("update:hpr", this.hpr)
    }
    get hpr() {
      var c;
      const {
        heading: e,
        roll: i,
        pitch: n
      } = jn(this.point, (c = this.orientation) == null ? void 0 : c.getValue(this._map.viewer.clock.currentTime)), s = l.Math.toDegrees(e), o = l.Math.toDegrees(i), a = l.Math.toDegrees(n);
      return {
        heading: s,
        roll: o,
        pitch: a,
        rotateZ: s,
        rotateX: o,
        rotateY: a
      }
    }
    set hpr(e) {
      this.rotate(e)
    }
    clampToGround() {
      if (!this._map) return;
      const e = this.options.position;
      if (!(!e || e.getValue)) return new R(e).clampToGround(this._map, {
        async: !0
      }).then(i => {
        this._position = i, this.entity && (this.entity.position = i), this.primitive && (this.primitive.position = i)
      }), this
    }
    clampToTerrain() {
      if (!this._map) return;
      const e = this.options.position;
      if (!(!e || e.getValue)) return new R(e).clampToTerrain(this._map, {
        async: !0
      }).then(i => {
        this._position = i.toCartesian3(), this.entity && (this.entity.position = i), this.primitive && (this.primitive.position = e)
      }), this
    }
    setStyle(e, i) {
      super.setStyle(e, i);
      const {
        clampToGround: n,
        addHeight: s,
        setHeight: o
      } = e;
      Xt([n, s, o]) && this._updatePosition()
    }
    toGeoJson() {
      return Gh(this.point.toLatLngArray(), {
        attr: this.attr,
        style: this.style,
        type: this.type
      })
    }
    get isPositionEditing() {
      return !!this._positionEdit
    }
    startPositionEdit(e) {
      !this._map || (this._positionEdit = new Lr({
        map: this._map,
        graphic: this,
        log: e
      }))
    }
    stopPositionEdit() {
      this._positionEdit && (this._positionEdit.destroy(), this._positionEdit = null)
    }
  }
  class Gr extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Ellipse);
      this.entity = new l.Entity({
        show: this.visible,
        polyline: {},
        ellipse: {}
      })
    }
    _updatePosition() {
      if (super._updatePosition(), ce(this.graphicStyle.extrudedHeight))
        if (this.options.position && this.options.position.getValue) this.entity.polyline.positions = new l.CallbackProperty(() => {
          const e = this.getOuterPositions({
            count: 90,
            position: this.point
          });
          return e && e.concat(e[0])
        }, !1);
        else {
          const e = this.getOuterPositions({
            count: 90
          });
          this.entity.polyline.positions = e && e.concat(e[0])
        }
    }
    setStyle(e, i = this.type) {
      super.setStyle(e, i), this._updateHelperLineStyle()
    }
    getOuterPositions(e) {
      var a, c, h;
      const i = this._map.viewer.clock.currentTime,
        n = ((a = this.style.semiAxis) == null ? void 0 : a.getValue) ? this.style.semiAxis.getValue(i) : this.style.semiAxis,
        s = ((c = this.style.semiMajorAxis) == null ? void 0 : c.getValue) ? this.style.semiMajorAxis.getValue(i) : this.style.semiMajorAxis,
        o = ((h = this.style.semiMinorAxis) == null ? void 0 : h.getValue) ? this.style.semiMinorAxis.getValue(i) : this.style.semiMinorAxis;
      return qn(j({
        position: this.point,
        semiMajorAxis: s,
        semiMinorAxis: o,
        semiAxis: n,
        rotation: 0
      }, e))
    }
  }
  class zi extends Gr {
    constructor() {
      super(...arguments);
      P(this, "type", G.Circle)
    }
    setStyle(e) {
      super.setStyle(e, G.Ellipse)
    }
    get radius() {
      return this._map ? this.style.semiAxis.getValue ? this.style.semiAxis.getValue(this._map.viewer.clock.currentTime) : this.style.semiAxis : this.style.semiAxis
    }
  }
  const Ii = 3.141592653589793 * 3e3 / 180,
    we = 3.141592653589793,
    Gs = 6378245,
    Fs = .006693421622965943;
  class kt {
    static BD09ToGCJ02(e, i) {
      let n = +e - .0065,
        s = +i - .006,
        o = Math.sqrt(n * n + s * s) - 2e-5 * Math.sin(s * Ii),
        a = Math.atan2(s, n) - 3e-6 * Math.cos(n * Ii),
        c = o * Math.cos(a),
        h = o * Math.sin(a);
      return [c, h]
    }
    static GCJ02ToBD09(e, i) {
      i = +i, e = +e;
      let n = Math.sqrt(e * e + i * i) + 2e-5 * Math.sin(i * Ii),
        s = Math.atan2(i, e) + 3e-6 * Math.cos(e * Ii),
        o = n * Math.cos(s) + .0065,
        a = n * Math.sin(s) + .006;
      return [o, a]
    }
    static WGS84ToGCJ02(e, i) {
      if (i = +i, e = +e, this.out_of_china(e, i)) return [e, i]; {
        let n = this.delta(e, i);
        return [e + n[0], i + n[1]]
      }
    }
    static GCJ02ToWGS84(e, i) {
      if (i = +i, e = +e, this.out_of_china(e, i)) return [e, i]; {
        let n = this.delta(e, i),
          s = e + n[0],
          o = i + n[1];
        return [e * 2 - s, i * 2 - o]
      }
    }
    static delta(e, i) {
      let n = this.transformLng(e - 105, i - 35),
        s = this.transformLat(e - 105, i - 35);
      const o = i / 180 * we;
      let a = Math.sin(o);
      a = 1 - Fs * a * a;
      const c = Math.sqrt(a);
      return n = n * 180 / (Gs / c * Math.cos(o) * we), s = s * 180 / (Gs * (1 - Fs) / (a * c) * we), [n, s]
    }
    static transformLng(e, i) {
      i = +i, e = +e;
      let n = 300 + e + 2 * i + .1 * e * e + .1 * e * i + .1 * Math.sqrt(Math.abs(e));
      return n += (20 * Math.sin(6 * e * we) + 20 * Math.sin(2 * e * we)) * 2 / 3, n += (20 * Math.sin(e * we) + 40 * Math.sin(e / 3 * we)) * 2 / 3, n += (150 * Math.sin(e / 12 * we) + 300 * Math.sin(e / 30 * we)) * 2 / 3, n
    }
    static transformLat(e, i) {
      i = +i, e = +e;
      let n = -100 + 2 * e + 3 * i + .2 * i * i + .1 * e * i + .2 * Math.sqrt(Math.abs(e));
      return n += (20 * Math.sin(6 * e * we) + 20 * Math.sin(2 * e * we)) * 2 / 3, n += (20 * Math.sin(i * we) + 40 * Math.sin(i / 3 * we)) * 2 / 3, n += (160 * Math.sin(i / 12 * we) + 320 * Math.sin(i * we / 30)) * 2 / 3, n
    }
    static out_of_china(e, i) {
      return i = +i, e = +e, !(e > 73.66 && e < 135.05 && i > 3.86 && i < 53.55)
    }
  }
  const Hs = new l.WebMercatorProjection;
  class R extends l.Cartesian3 {
    constructor(e, {
      setHeight: i,
      addHeight: n
    } = {}) {
      super();
      this.setValue(e, {
        setHeight: i,
        addHeight: n
      })
    }
    get height() {
      return this.toLatLng().alt
    }
    get value() {
      return {
        x: this.x,
        y: this.y,
        z: this.z
      }
    }
    set value(e) {
      if (!e) return;
      const {
        x: i,
        y: n,
        z: s
      } = uh(e);
      this.x = i, this.y = n, this.z = s
    }
    setValue(e, {
      setHeight: i,
      addHeight: n
    } = {}) {
      if (this.value = e, !!e) return U(n) && this.addHeight(n), U(i) && this.setHeight(i), this
    }
    addHeight(e) {
      return e ? (this.value = fh(this.value, e), this) : this
    }
    setHeight(e) {
      return ce(e) ? this : (this.value = mh(this.value, e), this)
    }
    _getDefaultExclude(e) {
      return e ? e.getAllGraphics().filter(i => {
        if (i.type !== G.Tileset) return i.primitive || i.entity
      }) : []
    }
    clampToGround(e, {
      async: i = !1,
      objectsToExclude: n
    } = {}) {
      if (!e) return console.warn("map is required!"), this;
      n = (n || this._getDefaultExclude(e)).map(a => a instanceof st ? a.primitive || a.entity : a).filter(Boolean);
      const s = e.viewer;
      if (i) {
        const a = this.toCartographic();
        return a ? Promise.all([new Promise(c => {
          const h = s.scene.globe.terrainProvider;
          if (h instanceof l.EllipsoidTerrainProvider) {
            c(0);
            return
          }
          return l.sampleTerrainMostDetailed(h, [a]).then(([{
            height: u = 0
          }]) => {
            c(u)
          })
        }), new Promise(c => {
          s.scene.sampleHeightMostDetailed([a], n).then(([{
            height: h = 0
          }]) => (c(h), this))
        })]).then(c => {
          let h = Math.max(...c);
          return h < -500 && (h = this.getHeightByGlobePick(e)), this.setHeight(h), this
        }) : Promise.resolve(this)
      }
      let o = s.scene.sampleHeight(this.toCartographic(), n);
      return (o === void 0 || o < -500) && (o = this.getHeightByGlobePick(e)), this.setHeight(o), this
    }
    clampToTerrain(e, {
      async: i = !1
    } = {}) {
      if (!e) return console.warn("map is required!"), this;
      const n = e.viewer;
      if (i) {
        const o = this.toCartographic();
        if (!o) return Promise.resolve(this);
        const a = n.scene.globe.terrainProvider;
        return a instanceof l.EllipsoidTerrainProvider ? (this.setHeight(0), Promise.resolve(this)) : l.sampleTerrainMostDetailed(a, [o]).then(([{
          height: c = 0
        }]) => (console.log(c), c < -500 && (c = this.getHeightByGlobePick(e)), this.setHeight(c), this))
      }
      let s = n.scene.globe.getHeight(this.toCartographic());
      return s < -500 && (s = this.getHeightByGlobePick(e)), this.setHeight(s), this
    }
    getHeightByGlobePick(e) {
      const i = e.viewer,
        n = i.scene.cartesianToCanvasCoordinates(this.value),
        s = i.scene.globe.pick(i.camera.getPickRay(n), i.scene);
      return s ? new R(s).height : 0
    }
    toMercator() {
      return Hs.project(this.toCartographic())
    }
    toLatLng() {
      const e = this.toCartographic(this.value),
        i = l.Math.toDegrees(e.latitude),
        n = l.Math.toDegrees(e.longitude),
        s = e.height;
      return {
        lng: n,
        lat: i,
        alt: s
      }
    }
    toLatLngArray() {
      const {
        lng: e,
        lat: i,
        alt: n
      } = this.toLatLng();
      return [e, i, n]
    }
    toCartesian3() {
      return new l.Cartesian3(this.x, this.y, this.z)
    }
    toCartographic() {
      const e = l.Cartographic.fromCartesian(this.value);
      return e && (e.height = Math.round(e.height * 1e3) / 1e3), e
    }
    clone() {
      return new R(this.value)
    }
    isInPolygon(e) {
      e instanceof st && (e = e.points);
      const i = this.toLatLng();
      return ts([i.lng, i.lat], e.map(n => new R(n).toLatLngArray()))
    }
    isInCircle(e) {
      e instanceof zi && (e = {
        point: e.point,
        radius: e.radius
      });
      const {
        point: i,
        radius: n
      } = e;
      return this.distance(i) <= n
    }
    distance(e) {
      return l.Cartesian3.distance(this, new R(e))
    }
    isZero() {
      const {
        x: e,
        y: i,
        z: n
      } = this;
      return !e && !i && !n
    }
    BDToWGS84() {
      const {
        lng: e,
        lat: i,
        alt: n
      } = this.toLatLng();
      let s = kt.BD09ToGCJ02(e, i);
      return s = kt.GCJ02ToWGS84(s[0], s[1]), this.setValue({
        lng: s[0],
        lat: s[1],
        alt: n
      }), this
    }
    WGS84ToBD() {
      const {
        lng: e,
        lat: i,
        alt: n
      } = this.toLatLng();
      let s = kt.WGS84ToGCJ02(e, i);
      return s = kt.GCJ02ToBD09(s[0], s[1]), this.setValue({
        lng: s[0],
        lat: s[1],
        alt: n
      }), this
    }
    GCJ02ToWGS84() {
      const {
        lng: e,
        lat: i,
        alt: n
      } = this.toLatLng();
      let s = kt.GCJ02ToWGS84(e, i);
      return this.setValue({
        lng: s[0],
        lat: s[1],
        alt: n
      }), this
    }
    WGS84ToGCJ02() {
      const {
        lng: e,
        lat: i,
        alt: n
      } = this.toLatLng();
      let s = kt.WGS84ToGCJ02(e, i);
      return this.setValue({
        lng: s[0],
        lat: s[1],
        alt: n
      }), this
    }
    static fromMercator(e, i) {
      return new R(Hs.unproject(e), i)
    }
    static fromPositions(e) {
      return new R(yr(e))
    }
    toCirclePoints(e) {
      return qn(se(j({
        count: 90
      }, e), {
        position: this
      }))
    }
  }
  const Ie = At(Array),
    ap = At(Number),
    Oe = At(Function),
    ge = At(Object),
    Ns = At(Boolean),
    Re = At(String),
    U = Vt(nr, hc),
    ce = nr,
    Us = bn(U),
    Xt = zn(U),
    Vs = bn(ce);
  zn(ce);
  const ne = rh;
  hr(nc, [Vt(ur("."), Dn), Ai]), hr(Hn(kn(Vt(Hn(Nc)))), [Vt(ur("."), yc), Ai]), hr(lh, [Vt(ur("."), Yc), Ai, Ai]);
  const zt = Un((r, e, i) => i && (i.getValue || i.update) ? i : ["label", "point", "polyline", "polygon"].includes(r) ? zt(e, i) : i),
    ye = Kc,
    lp = $c,
    Fr = lc,
    Hr = Gn,
    Ws = (r, ...e) => (e.forEach(i => {
      Object.entries(i).forEach(([n, s]) => {
        r[n] = s
      })
    }), r),
    Nr = (r, e, i = !0) => e[r] ? e[r].map(n => Nr(r, n, !1)).concat(i ? [] : e).flat(1 / 0) : e,
    Ur = function (r, e, {
      initArgs: i = [],
      replace: n = !0
    } = {}) {
      var s;
      for (const o in e)(ce(r[o]) || n) && (r[o] = e[o]);
      if ((s = r._extendInit) == null || s.call(r, ...i), r._extendDestroy) {
        const o = r.destroy;
        r.destroy = () => {
          o == null || o.call(this), r._extendDestroy()
        }
      }
    },
    Vr = function (r, e = {}, i) {
      if (!!e[r])
        for (const n of e[r]) {
          if (i(n)) return n;
          const s = Vr(r, n, i);
          if (s) return s
        }
    },
    Kt = () => Math.random().toString(36).substr(2),
    Oi = (r, e, i) => {
      const n = r.filter(a => e.some(c => i(a, c))),
        s = r.filter(a => !n.some(c => i(c, a)));
      return {
        insert: e.filter(a => !n.some(c => i(c, a))),
        remove: s,
        equal: n.map(a => ({
          oldVal: r.find(c => i(c, a)),
          newVal: e.find(c => i(c, a))
        }))
      }
    },
    js = function () {
      let r, e;
      const i = new Promise((n, s) => {
        r = n, e = s
      });
      return i.reject = e, i.resolve = r, i
    },
    Ue = (r, e = {}) => (Object.entries(e).forEach(([i, n]) => {
      r[i] = n
    }), r);

  function Wr(r, e) {
    const i = new l.WebMercatorProjection,
      n = i.project(new R(r).toCartographic());
    return l.Rectangle.fromCartographicArray([i.unproject({
      x: n.x - e,
      y: n.y - e,
      z: n.z
    }), i.unproject({
      x: n.x + e,
      y: n.y + e,
      z: n.z
    })])
  }
  const Jt = window.Cesium;

  function jr(r, e) {
    const i = r.prototype;
    r.prototype = {};
    const n = Object.getOwnPropertyNames(i).filter(s => s !== "constructor").reduce((s, o) => se(j({}, s), {
      [o]: Object.getOwnPropertyDescriptor(i, o)
    }), {});
    Object.defineProperties(r.prototype, j(j({}, n), e))
  }
  jr(Jt.MaterialAppearance, {
    renderState: {
      get() {
        return U(this.material.uniforms.depthTest) && (this._renderState.depthTest.enabled = this.material.uniforms.depthTest), this._renderState
      }
    }
  }), jr(Jt.Resource, {
    _templateValues: {
      get() {
        return j(j({}, Jt.Resource.defaultTemplateValues || {}), this.__templateValues)
      },
      set(r) {
        this.__templateValues = r
      }
    }
  });
  const cp = Jt.PolylineCollection.prototype.destroy;
  jr(Jt.PolylineCollection, {
    destroy: {
      get() {
        return function () {
          if (!(this._polylines && this._polylines.length !== 0)) return cp.apply(this, arguments)
        }
      }
    }
  });
  const hp = 637099681e-2,
    qs = [1289059486e-2, 836237787e-2, 5591021, 348198983e-2, 167804312e-2, 0],
    Ri = [75, 60, 45, 30, 15, 0],
    up = [
      [1410526172116255e-23, 898305509648872e-20, -1.9939833816331, 200.9824383106796, -187.2403703815547, 91.6087516669843, -23.38765649603339, 2.57121317296198, -.03801003308653, 173379812e-1],
      [-7435856389565537e-24, 8983055097726239e-21, -.78625201886289, 96.32687599759846, -1.85204757529826, -59.36935905485877, 47.40033549296737, -16.50741931063887, 2.28786674699375, 1026014486e-2],
      [-3030883460898826e-23, 898305509983578e-20, .30071316287616, 59.74293618442277, 7.357984074871, -25.38371002664745, 13.45380521110908, -3.29883767235584, .32710905363475, 685681737e-2],
      [-1981981304930552e-23, 8983055099779535e-21, .03278182852591, 40.31678527705744, .65659298677277, -4.44255534477492, .85341911805263, .12923347998204, -.04625736007561, 448277706e-2],
      [309191371068437e-23, 8983055096812155e-21, 6995724062e-14, 23.10934304144901, -.00023663490511, -.6321817810242, -.00663494467273, .03430082397953, -.00466043876332, 25551644e-1],
      [2890871144776878e-24, 8983055095805407e-21, -3068298e-14, 7.47137025468032, -353937994e-14, -.02145144861037, -1234426596e-14, .00010322952773, -323890364e-14, 826088.5]
    ],
    Qs = [
      [-.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5],
      [.0008277824516172526, 111320.7020463578, 6477955746671607e-7, -4082003173641316e-6, 1077490566351142e-5, -1517187553151559e-5, 1205306533862167e-5, -5124939663577472e-6, 9133119359512032e-7, 67.5],
      [.00337398766765, 111320.7020202162, 4481351045890365e-9, -2339375119931662e-8, 7968221547186455e-8, -1159649932797253e-7, 9723671115602145e-8, -4366194633752821e-8, 8477230501135234e-9, 52.5],
      [.00220636496208, 111320.7020209128, 51751.86112841131, 3796837749470245e-9, 992013.7397791013, -122195221711287e-8, 1340652697009075e-9, -620943.6990984312, 144416.9293806241, 37.5],
      [-.0003441963504368392, 111320.7020576856, 278.2353980772752, 2485758690035394e-9, 6070.750963243378, 54821.18345352118, 9540.606633304236, -2710.55326746645, 1405.483844121726, 22.5],
      [-.0003218135878613132, 111320.7020701615, .00369383431289, 823725.6402795718, .46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, .37238884252424, 7.45]
    ];
  class dp {
    constructor() {
      this.isWgs84 = !1
    }
    getDistanceByMC(e, i) {
      if (!e || !i || (e = this.convertMC2LL(e), !e)) return 0;
      let n = this.toRadians(e.lng),
        s = this.toRadians(e.lat);
      if (i = this.convertMC2LL(i), !i) return 0;
      let o = this.toRadians(i.lng),
        a = this.toRadians(i.lat);
      return this.getDistance(n, o, s, a)
    }
    getDistanceByLL(e, i) {
      if (!e || !i) return 0;
      e.lng = this.getLoop(e.lng, -180, 180), e.lat = this.getRange(e.lat, -74, 74), i.lng = this.getLoop(i.lng, -180, 180), i.lat = this.getRange(i.lat, -74, 74);
      let n = this.toRadians(e.lng),
        s = this.toRadians(e.lat),
        o = this.toRadians(i.lng),
        a = this.toRadians(i.lat);
      return this.getDistance(n, o, s, a)
    }
    convertMC2LL(e) {
      if (!e) return {
        lng: 0,
        lat: 0
      };
      let i = {};
      if (this.isWgs84) {
        i.lng = e.lng / 2003750834e-2 * 180;
        let o = e.lat / 2003750834e-2 * 180;
        return i.lat = 180 / Math.PI * (2 * Math.atan(Math.exp(o * Math.PI / 180)) - Math.PI / 2), {
          lng: i.lng.toFixed(6),
          lat: i.lat.toFixed(6)
        }
      }
      let n = {
          lng: Math.abs(e.lng),
          lat: Math.abs(e.lat)
        },
        s;
      for (let o = 0; o < qs.length; o++)
        if (n.lat >= qs[o]) {
          s = up[o];
          break
        } return i = this.convertor(e, s), {
        lng: i.lng.toFixed(6),
        lat: i.lat.toFixed(6)
      }
    }
    convertLL2MC(e) {
      if (!e) return {
        lng: 0,
        lat: 0
      };
      if (e.lng > 180 || e.lng < -180 || e.lat > 90 || e.lat < -90) return e;
      if (this.isWgs84) {
        let o = {},
          a = 6378137;
        o.lng = e.lng * Math.PI / 180 * a;
        let c = e.lat * Math.PI / 180;
        return o.lat = a / 2 * Math.log((1 + Math.sin(c)) / (1 - Math.sin(c))), {
          lng: parseFloat(o.lng.toFixed(2)),
          lat: parseFloat(o.lat.toFixed(2))
        }
      }
      e.lng = this.getLoop(e.lng, -180, 180), e.lat = this.getRange(e.lat, -74, 74);
      let i = {
          lng: e.lng,
          lat: e.lat
        },
        n;
      for (let o = 0; o < Ri.length; o++)
        if (i.lat >= Ri[o]) {
          n = Qs[o];
          break
        } if (!n) {
        for (let o = 0; o < Ri.length; o++)
          if (i.lat <= -Ri[o]) {
            n = Qs[o];
            break
          }
      }
      let s = this.convertor(e, n);
      return {
        lng: parseFloat(s.lng.toFixed(2)),
        lat: parseFloat(s.lat.toFixed(2))
      }
    }
    convertor(e, i) {
      if (!e || !i) return {
        lng: 0,
        lat: 0
      };
      let n = i[0] + i[1] * Math.abs(e.lng),
        s = Math.abs(e.lat) / i[9],
        o = i[2] + i[3] * s + i[4] * s * s + i[5] * s * s * s + i[6] * s * s * s * s + i[7] * s * s * s * s * s + i[8] * s * s * s * s * s * s;
      return n *= e.lng < 0 ? -1 : 1, o *= e.lat < 0 ? -1 : 1, {
        lng: n,
        lat: o
      }
    }
    getDistance(e, i, n, s) {
      return hp * Math.acos(Math.sin(n) * Math.sin(s) + Math.cos(n) * Math.cos(s) * Math.cos(i - e))
    }
    toRadians(e) {
      return Math.PI * e / 180
    }
    toDegrees(e) {
      return 180 * e / Math.PI
    }
    getRange(e, i, n) {
      return i != null && (e = Math.max(e, i)), n != null && (e = Math.min(e, n)), e
    }
    getLoop(e, i, n) {
      for (; e > n;) e -= n - i;
      for (; e < i;) e += n - i;
      return e
    }
    lngLatToMercator(e) {
      return this.convertLL2MC(e)
    }
    lngLatToPoint(e) {
      let i = this.convertLL2MC(e);
      return {
        x: i.lng,
        y: i.lat
      }
    }
    mercatorToLngLat(e) {
      return this.convertMC2LL(e)
    }
    pointToLngLat(e) {
      let i = {
        lng: e.x,
        lat: e.y
      };
      return this.convertMC2LL(i)
    }
    pointToPixel(e, i, n, s) {
      if (!e) return;
      e = this.lngLatToMercator(e);
      let o = this.getZoomUnits(i),
        a = Math.round((e.lng - n.lng) / o + s.width / 2),
        c = Math.round((n.lat - e.lat) / o + s.height / 2);
      return {
        x: a,
        y: c
      }
    }
    pixelToPoint(e, i, n, s) {
      if (!e) return;
      let o = this.getZoomUnits(i),
        a = n.lng + o * (e.x - s.width / 2),
        c = n.lat - o * (e.y - s.height / 2),
        h = {
          lng: a,
          lat: c
        };
      return this.mercatorToLngLat(h)
    }
    getZoomUnits(e) {
      return Math.pow(2, 18 - e)
    }
  }
  const Bi = 3.141592653589793 * 3e3 / 180,
    Ce = 3.141592653589793,
    Ys = 6378245,
    Xs = .006693421622965943;
  class It {
    static BD09ToGCJ02(e, i) {
      let n = +e - .0065,
        s = +i - .006,
        o = Math.sqrt(n * n + s * s) - 2e-5 * Math.sin(s * Bi),
        a = Math.atan2(s, n) - 3e-6 * Math.cos(n * Bi),
        c = o * Math.cos(a),
        h = o * Math.sin(a);
      return [c, h]
    }
    static GCJ02ToBD09(e, i) {
      i = +i, e = +e;
      let n = Math.sqrt(e * e + i * i) + 2e-5 * Math.sin(i * Bi),
        s = Math.atan2(i, e) + 3e-6 * Math.cos(e * Bi),
        o = n * Math.cos(s) + .0065,
        a = n * Math.sin(s) + .006;
      return [o, a]
    }
    static WGS84ToGCJ02(e, i) {
      if (i = +i, e = +e, this.out_of_china(e, i)) return [e, i];
      let n = this.delta(e, i);
      return [e + n[0], i + n[1]]
    }
    static GCJ02ToWGS84(e, i) {
      if (i = +i, e = +e, this.out_of_china(e, i)) return [e, i];
      let n = this.delta(e, i),
        s = e + n[0],
        o = i + n[1];
      return [e * 2 - s, i * 2 - o]
    }
    static delta(e, i) {
      let n = this.transformLng(e - 105, i - 35),
        s = this.transformLat(e - 105, i - 35);
      const o = i / 180 * Ce;
      let a = Math.sin(o);
      a = 1 - Xs * a * a;
      const c = Math.sqrt(a);
      return n = n * 180 / (Ys / c * Math.cos(o) * Ce), s = s * 180 / (Ys * (1 - Xs) / (a * c) * Ce), [n, s]
    }
    static transformLng(e, i) {
      i = +i, e = +e;
      let n = 300 + e + 2 * i + .1 * e * e + .1 * e * i + .1 * Math.sqrt(Math.abs(e));
      return n += (20 * Math.sin(6 * e * Ce) + 20 * Math.sin(2 * e * Ce)) * 2 / 3, n += (20 * Math.sin(e * Ce) + 40 * Math.sin(e / 3 * Ce)) * 2 / 3, n += (150 * Math.sin(e / 12 * Ce) + 300 * Math.sin(e / 30 * Ce)) * 2 / 3, n
    }
    static transformLat(e, i) {
      i = +i, e = +e;
      let n = -100 + 2 * e + 3 * i + .2 * i * i + .1 * e * i + .2 * Math.sqrt(Math.abs(e));
      return n += (20 * Math.sin(6 * e * Ce) + 20 * Math.sin(2 * e * Ce)) * 2 / 3, n += (20 * Math.sin(i * Ce) + 40 * Math.sin(i / 3 * Ce)) * 2 / 3, n += (160 * Math.sin(i / 12 * Ce) + 320 * Math.sin(i * Ce / 30)) * 2 / 3, n
    }
    static out_of_china(e, i) {
      return i = +i, e = +e, !(e > 73.66 && e < 135.05 && i > 3.86 && i < 53.55)
    }
  }
  class Ks extends Cesium.WebMercatorTilingScheme {
    constructor(e) {
      super(e);
      let i = new dp;
      this._projection.project = function (o, a) {
        return a = a || {}, a = It.WGS84ToGCJ02(Cesium.Math.toDegrees(o.longitude), Cesium.Math.toDegrees(o.latitude)), a = It.GCJ02ToBD09(a[0], a[1]), a[0] = Math.min(a[0], 180), a[0] = Math.max(a[0], -180), a[1] = Math.min(a[1], 74.000022), a[1] = Math.max(a[1], -71.988531), a = i.lngLatToPoint({
          lng: a[0],
          lat: a[1]
        }), new Cesium.Cartesian2(a.x, a.y)
      }, this._projection.unproject = function (o, a) {
        return a = a || {}, a = i.mercatorToLngLat({
          lng: o.x,
          lat: o.y
        }), a = It.BD09ToGCJ02(a.lng, a.lat), a = It.GCJ02ToWGS84(a[0], a[1]), new Cesium.Cartographic(Cesium.Math.toRadians(a[0]), Cesium.Math.toRadians(a[1]))
      }, this.resolutions = e.resolutions || [];
      const n = this._projection.unproject(this._rectangleSouthwestInMeters),
        s = this._projection.unproject(this._rectangleNortheastInMeters);
      this._rectangle = new Cesium.Rectangle(n.longitude, n.latitude, s.longitude, s.latitude)
    }
    tileXYToNativeRectangle(e, i, n, s) {
      const o = this.resolutions[n],
        a = e * o,
        c = (e + 1) * o,
        h = ((i = -i) + 1) * o,
        u = i * o;
      return Cesium.defined(s) ? (s.west = a, s.south = u, s.east = c, s.north = h, s) : new Cesium.Rectangle(a, u, c, h)
    }
    positionToTileXY(e, i, n) {
      const s = this._rectangle;
      if (!Cesium.Rectangle.contains(s, e)) return;
      const a = this._projection.project(e);
      if (!Cesium.defined(a)) return;
      const c = this.resolutions[i],
        h = Math.floor(a.x / c),
        u = -Math.floor(a.y / c);
      return Cesium.defined(n) ? (n.x = h, n.y = u, n) : new Cesium.Cartesian2(h, u)
    }
  }
  const pp = "http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",
    fp = "http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",
    mp = "http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";
  class gp {
    constructor(e = {}) {
      if (this._url = e.style === "img" ? pp : e.style === "vec" ? fp : mp, this._tileWidth = 256, this._tileHeight = 256, this._maximumLevel = 18, this._crs = e.crs || "BD09", e.crs === "WGS84") {
        let i = [];
        for (let n = 0; n < 19; n++) i[n] = 256 * Math.pow(2, 18 - n);
        this._tilingScheme = new Ks({
          resolutions: i,
          rectangleSouthwestInMeters: new Cesium.Cartesian2(-2003772637e-2, -1247410417e-2),
          rectangleNortheastInMeters: new Cesium.Cartesian2(2003772637e-2, 1247410417e-2)
        })
      } else this._tilingScheme = new Cesium.WebMercatorTilingScheme({
        rectangleSouthwestInMeters: new Cesium.Cartesian2(-33554054, -33746824),
        rectangleNortheastInMeters: new Cesium.Cartesian2(33554054, 33746824)
      });
      this._rectangle = this._tilingScheme.rectangle, this._credit = void 0, this._style = e.style || "normal"
    }
    get url() {
      return this._url
    }
    get token() {
      return this._token
    }
    get tileWidth() {
      if (!this.ready) throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.");
      return this._tileWidth
    }
    get tileHeight() {
      if (!this.ready) throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.");
      return this._tileHeight
    }
    get maximumLevel() {
      if (!this.ready) throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");
      return this._maximumLevel
    }
    get minimumLevel() {
      if (!this.ready) throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");
      return 0
    }
    get tilingScheme() {
      if (!this.ready) throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");
      return this._tilingScheme
    }
    get rectangle() {
      if (!this.ready) throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.");
      return this._rectangle
    }
    get ready() {
      return !!this._url
    }
    get credit() {
      return this._credit
    }
    get hasAlphaChannel() {
      return !0
    }
    getTileCredits(e, i, n) {}
    requestImage(e, i, n) {
      if (!this.ready) throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");
      let s = this._tilingScheme.getNumberOfXTilesAtLevel(n),
        o = this._tilingScheme.getNumberOfYTilesAtLevel(n),
        a = this._url.replace("{z}", n).replace("{s}", String(1)).replace("{style}", this._style);
      return this._crs === "WGS84" ? a = a.replace("{x}", String(e)).replace("{y}", String(-i)) : a = a.replace("{x}", String(e - s / 2)).replace("{y}", String(o / 2 - i - 1)), Cesium.ImageryProvider.loadImage(this, a)
    }
  }
  class Js extends Cesium.WebMercatorTilingScheme {
    constructor(e) {
      super(e);
      let i = new Cesium.WebMercatorProjection;
      this._projection.project = function (n, s) {
        return s = It.WGS84ToGCJ02(Cesium.Math.toDegrees(n.longitude), Cesium.Math.toDegrees(n.latitude)), s = i.project(new Cesium.Cartographic(Cesium.Math.toRadians(s[0]), Cesium.Math.toRadians(s[1]))), new Cesium.Cartesian2(s.x, s.y)
      }, this._projection.unproject = function (n, s) {
        let o = i.unproject(n);
        return s = It.GCJ02ToWGS84(Cesium.Math.toDegrees(o.longitude), Cesium.Math.toDegrees(o.latitude)), new Cesium.Cartographic(Cesium.Math.toRadians(s[0]), Cesium.Math.toRadians(s[1]))
      }
    }
  }
  const yp = "https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
    vp = "https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
    _p = "https://webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}";
  class wp extends Cesium.UrlTemplateImageryProvider {
    constructor(e = {}) {
      e.url = e.style === "img" ? yp : e.style === "cva" ? _p : vp, (!e.subdomains || !e.subdomains.length) && (e.subdomains = ["01", "02", "03", "04"]), e.crs === "WGS84" && (e.tilingScheme = new Js);
      super(e)
    }
  }
  const Cp = "https://p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400",
    xp = "https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347";
  class bp extends Cesium.UrlTemplateImageryProvider {
    constructor(e = {}) {
      let i = e.style === "img" ? Cp : xp;
      e.url = i.replace("{style}", e.style || 1), (!e.subdomains || !e.subdomains.length) && (e.subdomains = ["0", "1", "2"]), e.style === "img" && (e.customTags = {
        sx: (n, s, o, a) => s >> 4,
        sy: (n, s, o, a) => (1 << a) - o >> 4
      });
      super(e)
    }
  }
  const Ap = "//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}";
  class Pp extends Cesium.UrlTemplateImageryProvider {
    constructor(e = {}) {
      super({
        url: Ap.replace(/\{style\}/g, e.style || "vec").replace(/\{key\}/g, e.key || ""),
        subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
        tilingScheme: new Cesium.WebMercatorTilingScheme,
        maximumLevel: (i = e.maximumLevel) != null ? i : 18
      });
      var i
    }
  }
  const Sp = "http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",
    Tp = "http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",
    Mp = "http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";
  class Ep extends Cesium.UrlTemplateImageryProvider {
    constructor(e = {}) {
      e.url = e.style === "img" ? Tp : e.style === "ter" ? Mp : Sp, (!e.subdomains || !e.subdomains.length) && (e.subdomains = ["1", "2", "3"]);
      super(e)
    }
  }
  l.AmapImageryProvider = wp, l.BaiduImageryProvider = gp, l.TencentImageryProvider = bp, l.TdtImageryProvider = Pp, l.GoogleImageryProvider = Ep;
  var $s = {
    editorUrl: "http://192.168.0.191/VAPSEarthEditor-local/#/sdk",
    infoBox: !1,
    animation: !1,
    timeline: !1,
    vrButton: !1,
    geocoder: !1,
    sceneModePicker: !1,
    homeButton: !1,
    navigationHelpButton: !1,
    baseLayerPicker: !1,
    selectionIndicator: !1,
    baseMaps: [{
      id: 2021,
      name: "\u5929\u5730\u56FE\u5F71\u50CF",
      icon: l.buildModuleUrl("../img/basemaps/tdt_img.png"),
      type: "tdt",
      layer: "img"
    }, {
      id: 1,
      name: "\u5929\u5730\u56FE\u5F71\u50CF(\u6807\u6CE8)",
      icon: l.buildModuleUrl("../img/basemaps/tdt_img.png"),
      type: "group",
      layers: [{
        type: "tdt",
        layer: "img",
        name: "\u5929\u5730\u56FE\u5F71\u50CF(\u6807\u6CE8)"
      }, {
        type: "tdt",
        layer: "cva"
      }]
    }, {
      id: 3,
      name: "\u5929\u5730\u56FE\u7535\u5B50",
      icon: l.buildModuleUrl("../img/basemaps/tdt_vec.png"),
      type: "group",
      layers: [{
        name: "\u5929\u5730\u56FE\u7535\u5B50",
        type: "tdt",
        layer: "vec"
      }, {
        type: "tdt",
        layer: "cva"
      }]
    }, {
      id: 4,
      name: "\u5929\u5730\u56FE\u5730\u5F62",
      icon: l.buildModuleUrl("../img/basemaps/tdt_vec.png"),
      type: "tdt",
      layer: "ter"
    }, {
      id: 5,
      name: "\u9AD8\u5FB7\u5F71\u50CF",
      icon: l.buildModuleUrl("../img/basemaps/gaode_img.png"),
      type: "gaode",
      layer: "img",
      maximumLevel: 16
    }, {
      id: 6,
      name: "\u9AD8\u5FB7\u5F71\u50CF\uFF08\u6807\u6CE8\uFF09",
      type: "group",
      icon: l.buildModuleUrl("../img/basemaps/gaode_img.png"),
      layers: [{
        name: "\u9AD8\u5FB7\u5F71\u50CF",
        type: "gaode",
        layer: "img",
        maximumLevel: 16
      }, {
        name: "\u9AD8\u5FB7\u6807\u6CE8",
        type: "gaode",
        layer: "cva",
        maximumLevel: 16
      }]
    }, {
      id: 7,
      name: "\u9AD8\u5FB7\u7535\u5B50",
      type: "gaode",
      icon: l.buildModuleUrl("../img/basemaps/gaode_vec.png"),
      layer: "elec",
      maximumLevel: 18
    }, {
      id: 8,
      name: "\u767E\u5EA6\u5F71\u50CF",
      type: "baidu",
      icon: l.buildModuleUrl("../img/basemaps/bd-img.png"),
      layer: "img"
    }, {
      id: 9,
      name: "\u767E\u5EA6\u5F71\u50CF\uFF08\u6807\u6CE8\uFF09",
      type: "group",
      icon: l.buildModuleUrl("../img/basemaps/bd-img.png"),
      layers: [{
        name: "\u767E\u5EA6\u5F71\u50CF\uFF08\u6807\u6CE8\uFF09",
        type: "baidu",
        layer: "img"
      }, {
        type: "baidu",
        layer: "vec"
      }]
    }, {
      id: 10,
      name: "\u767E\u5EA6\u7535\u5B50",
      icon: l.buildModuleUrl("../img/basemaps/bd-vec.png"),
      type: "baidu",
      layer: "normal"
    }, {
      id: 12,
      name: "ArcGIS\u5F71\u50CF",
      icon: l.buildModuleUrl("../img/basemaps/esriWorldImagery.png"),
      type: "xyz",
      url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
      maximumLevel: 18
    }, {
      id: 21,
      name: "\u84DD\u8272\u5E95\u56FE",
      icon: l.buildModuleUrl("../img/basemaps/bd-c-midnight.png"),
      type: "xyz",
      chinaCrs: "GCJ02",
      url: "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"
    }, {
      id: 22,
      name: "\u9ED1\u8272\u5E95\u56FE",
      icon: l.buildModuleUrl("../img/basemaps/bd-c-dark.png"),
      type: "xyz",
      chinaCrs: "GCJ02",
      url: "https://rt1.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=4&scene=0"
    }, {
      id: 19,
      name: "\u7F51\u683C",
      type: "grid",
      backgroundColor: "transparent",
      icon: l.buildModuleUrl("../img/basemaps/grid.png"),
      cells: 2,
      color: "rgba(255,255,255,.01)",
      glowColor: "rgba(255,255,255,.01)",
      glowWidth: 2
    }, {
      id: 0,
      name: "\u65E0\u5E95\u56FE",
      type: "none",
      icon: l.buildModuleUrl("../img/basemaps/none.png")
    }],
    imageryProvider: 5,
    contextOptions: {
      webgl: {
        alpha: !0,
        preserveDrawingBuffer: !0
      }
    },
    scene: {
      sun: {
        show: !1
      },
      moon: {
        show: !1
      },
      globe: {
        depthTestAgainstTerrain: !1
      },
      postProcessStages: {
        fxaa: {
          enabled: !0
        }
      },
      debugShowFramesPerSecond: !1
    },
    resolutionScale: window.devicePixelRatio,
    clock: {
      currentTime: l.JulianDate.fromDate(new Date("2021/9/01 12:00:00")),
      shouldAnimate: !1
    },
    terrainProviderViewModels: [],
    fullscreenButton: !1
  };
  class Dp {
    constructor(e) {
      P(this, "getTileCredits", function (e, i, n) {});
      P(this, "requestImage", function (e, i, n) {
        let s = document.createElement("canvas");
        if (s.width = 256, s.height = 256, n < this._minimumLevel || l.defined(this._maximumLevel) && n > this._maximumLevel) return s;
        if (this.options.debuggerTileInfo) {
          let o = s.getContext("2d");
          o.strokeStyle = "#ffff00", o.lineWidth = 2, o.strokeRect(1, 1, 255, 255);
          let a = `L${n}X${e}Y${i}`;
          o.font = "bold 25px Arial", o.textAlign = "center", o.fillStyle = "black", o.fillText(a, 127, 127), o.fillStyle = "#ffff00", o.fillText(a, 124, 124)
        }
        return s
      });
      P(this, "_getGridKey", function (e) {
        return `${e.level}_x${e.x}_y${e.y}`
      });
      P(this, "addImageryCache", function (e) {
        e.level < this._minimumLevel || e.level < e.maxLevel - 1 || l.defined(this._maximumLevel) && e.level > this._maximumLevel || this.options.addImageryCache && (e.key = this._getGridKey(e), this.options.addImageryCache(e))
      });
      P(this, "removeImageryCache", function (e) {
        if ((e.maxLevel < this._minimumLevel || l.defined(this._maximumLevel) && e.level > this._maximumLevel) && this.options.removeAllImageryCache) {
          this.options.removeAllImageryCache();
          return
        }
        this.options.removeImageryCache && (e.key = this._getGridKey(e), this.options.removeImageryCache(e))
      });
      if (e = l.defaultValue(e, l.defaultValue.EMPTY_OBJECT), this.options = e, this._tileWidth = l.defaultValue(e.tileWidth, 256), this._tileHeight = l.defaultValue(e.tileHeight, 256), this._minimumLevel = l.defaultValue(e.minimumLevel, 0), this._maximumLevel = e.maximumLevel, e.rectangle && e.rectangle.xmin && e.rectangle.xmax && e.rectangle.ymin && e.rectangle.ymax) {
        let i = e.rectangle.xmin,
          n = e.rectangle.xmax,
          s = e.rectangle.ymin,
          o = e.rectangle.ymax;
        e.rectangle = l.Rectangle.fromDegrees(i, s, n, o)
      }
      this._tilingScheme = l.defaultValue(e.tilingScheme, new l.GeographicTilingScheme({
        ellipsoid: e.ellipsoid
      })), this._rectangle = l.defaultValue(e.rectangle, this._tilingScheme.rectangle), this._rectangle = l.Rectangle.intersection(this._rectangle, this._tilingScheme.rectangle), this._hasAlphaChannel = l.defaultValue(e.hasAlphaChannel, !0), this._errorEvent = new l.Event, this._readyPromise = l.when.resolve(!0), this._credit = void 0, this._ready = !0
    }
    get url() {
      return this._url
    }
    get token() {
      return this._token
    }
    get proxy() {
      return this._proxy
    }
    get tileWidth() {
      if (!this._ready) throw new Error("tileWidth must not be called before the imagery provider is ready.");
      return this._tileWidth
    }
    get tileHeight() {
      if (!this._ready) throw new Error("tileHeight must not be called before the imagery provider is ready.");
      return this._tileHeight
    }
    get maximumLevel() {
      if (!this._ready) throw new Error("maximumLevel must not be called before the imagery provider is ready.");
      return this._maximumLevel
    }
    get minimumLevel() {
      if (!this._ready) throw new Error("minimumLevel must not be called before the imagery provider is ready.");
      return 0
    }
    get tilingScheme() {
      if (!this._ready) throw new Error("tilingScheme must not be called before the imagery provider is ready.");
      return this._tilingScheme
    }
    get rectangle() {
      if (!this._ready) throw new Error("rectangle must not be called before the imagery provider is ready.");
      return this._rectangle
    }
    get tileDiscardPolicy() {
      if (!this._ready) throw new Error("tileDiscardPolicy must not be called before the imagery provider is ready.");
      return this._tileDiscardPolicy
    }
    get errorEvent() {
      return this._errorEvent
    }
    get ready() {
      return this._ready
    }
    get readyPromise() {
      return this._readyPromise.promise
    }
    get credit() {
      return this._credit
    }
    get usingPrecachedTiles() {
      return this._useTiles
    }
    get hasAlphaChannel() {
      return !0
    }
    get layers() {
      return this._layers
    }
  }
  const kp = [338032714321e-20, 676065428641e-20, 1352130857282e-20, 2704261714564e-20, 5408523429128e-20, 10817046858257e-20, 21634093716514e-20, 43268187433028e-20, 86536374866056e-20, 173072749732112e-20, 346145499464224e-20, 692290998928448e-20, 13845819978568952e-21, 27691639957137904e-21, 5538327991427581e-20, .00011076655982855162, .00022153311965710323, .00044306623931420646, .0008861324786284129, .0017722649572568258, .0035445299145136517, .007089059829027303],
    zp = [16901635716e-19, 338032714321e-20, 676065428641e-20, 1352130857282e-20, 2704261714564e-20, 5408523429128e-20, 10817046858257e-20, 21634093716514e-20, 43268187433028e-20, 86536374866056e-20, 173072749732112e-20, 346145499464224e-20, 692290998928448e-20, 13845819978568952e-21, 27691639957137904e-21, 5538327991427581e-20, .00011076655982855162, .00022153311965710323, .00044306623931420646, .0008861324786284129, .0017722649572568258, .0035445299145136517, .007089059829027303];
  class Ip extends l.UrlTemplateImageryProvider {
    constructor(e) {
      const i = ne({
          minimumLevel: 0,
          maximumLevel: 18,
          crs: 3857,
          token: ""
        }, e),
        n = l.Rectangle.fromDegrees(-180, -90, 180, 90),
        s = i.crs;
      let o = "",
        a = 0,
        c = 22,
        h = 0,
        u = 0;
      s == 4326 && (o = new l.GeographicTilingScheme({
        numberOfLevelZeroTilesX: 2,
        numberOfLevelZeroTilesY: 1
      }), h = -180, u = 90, i.minimumLevel !== void 0 ? a = i.minimumLevel : a = 0, i.maximumLevel !== void 0 ? c = i.maximumLevel : c = 22), s == 3857 && (o = new l.WebMercatorTilingScheme, h = -2003750834e-2, u = 2003750834e-2, i.minimumLevel !== void 0 ? a = i.minimumLevel : a = 0, i.maximumLevel !== void 0 ? c = i.maximumLevel : c = 22);
      const d = JSON.stringify({
          x: h,
          y: u
        }),
        p = `${i.url}/tileImage.png?transparent=true&cacheEnabled=true&_cache=true&width=256&height=256&redirect=false&overlapDisplayed=false&x={x}&y={y}&scale={scale}&token=${i.token}&key=${i.key}`;
      super({
        url: p,
        rectangle: n,
        minimumLevel: a || 0,
        maximumLevel: c || 22,
        tilingScheme: o,
        customTags: {
          scale: (f, m, g, y) => {
            if (s == 4326) return kp[y];
            if (s == 3857) return zp[y]
          },
          origin: () => d
        }
      })
    }
  }
  var Op = {
    _extendInit() {},
    _currentMapId: null,
    getCurrentMapId() {
      return this.viewer.baseLayerPicker ? this._currentMapId : (console.warn("baseLayerPicker \u4E3Atrue \u65F6\uFF0C\u624D\u5B58\u5728currentMapId"), null)
    },
    setImagerLayers(r) {
      requestAnimationFrame(() => {
        r.forEach(e => {
          e.show = !0;
          const i = this.addBaseMap(e);
          U(e.show) && i.filter(Boolean).forEach(n => {
            n.show = e.show
          })
        })
      })
    },
    initBaseMaps(r) {
      if (r.baseLayerPicker) {
        const e = this._getImageryProviderArr(r.baseMaps);
        if (r.imageryProviderViewModels = e, r.imageryProvider) {
          const i = e.find(n => n.id === r.imageryProvider) || e[0];
          i && (r.selectedImageryProviderViewModel = i, this._currentMapId = i.id)
        }
        return
      }
      if (r.imageryProvider) {
        const e = this.options.baseMaps.find(i => i.id === r.imageryProvider);
        e && setTimeout(() => {
          this.addBaseMap(e)
        }, 0)
      }
    },
    _getImageryProviderArr(r) {
      let e = [];
      return r.forEach(i => {
        let n = new l.ProviderViewModel({
          name: i.name || "\u672A\u547D\u540D",
          tooltip: i.name || "\u672A\u547D\u540D",
          iconUrl: i.icon || "",
          creationFunction: i.type === "group" ? () => (setTimeout(() => {
            this._currentMapId = i.id, console.log(`\u5F53\u524D\u5730\u56FE\u4E3A ${this._currentMapId}`), this.fire("currentMapIdChange", i.id)
          }, 0), i.layers.map(s => this.createImageryProvider(j({
            id: i.id,
            group: i
          }, s)))) : () => (setTimeout(() => {
            this._currentMapId = i.id, console.log(`\u5F53\u524D\u5730\u56FE\u4E3A ${this._currentMapId}`), this.fire("currentMapIdChange", i.id)
          }, 0), this.createImageryProvider(i))
        });
        e.push(n), n.id = i.id
      }), e
    },
    setLayerOptions(r, e = {}) {
      if (ge(r) && (r = r.id), !r) return;
      this.getImageryLayersById(r).forEach(n => {
        Object.entries(e).forEach(([s, o]) => {
          n[s] = o
        })
      });
      const i = this.getAllImageryLayersConfig().find(n => n.id === r);
      i && (i.layerOptions || (i.layerOptions = {}), Object.entries(e).forEach(([n, s]) => {
        i.layerOptions[n] = s
      }))
    },
    getImageryLayersById(r) {
      return this.getAllImageryLayers().filter(e => {
        var i;
        if (!!((i = e.imageryProvider) == null ? void 0 : i.config)) return e.imageryProvider.config.id === r
      })
    },
    getAllImageryLayers() {
      const r = [];
      for (let e = 0; e < this.viewer.imageryLayers.length; e++) {
        const i = this.viewer.imageryLayers.get(e);
        r.push(i)
      }
      return r
    },
    getAllImageryLayersConfig() {
      return this.getAllImageryLayers().map(e => se(j({}, e.imageryProvider.config), {
        show: e.show
      })).filter(Boolean).reduce((e, i) => (e.some(n => n.id === i.id) || (i.group ? e.push(i.group) : e.push(i)), e), [])
    },
    addBaseMap(r) {
      r.id || (r.id = Kt());
      const e = this.getImageryLayersById(r.id);
      if (!e.length) {
        if (r.type === "group") r.layers.forEach(i => {
          const n = this.createImageryProvider(se(j({}, i), {
              id: r.id,
              group: r
            })),
            s = new l.ImageryLayer(n);
          e.push(this.viewer.imageryLayers.add(s))
        });
        else {
          const i = this.createImageryProvider(r),
            n = new l.ImageryLayer(i);
          e.push(this.viewer.imageryLayers.add(n))
        }
        this.options.baseLayerPicker && (this._currentMapId = r.id, console.log(`\u5F53\u524D\u5730\u56FE\u4E3A ${this._currentMapId}`), this.fire("currentMapIdChange", r.id))
      }
      return r.layerOptions && this.setLayerOptions(r.id, r.layerOptions), e
    },
    createImageryProvider(r) {
      var o, a;
      if (r.type === "none") return [];
      let e = {};
      for (let c in r) {
        let h = r[c];
        if (h != null) switch (e[c] = h, c) {
          default:
            break;
          case "crs":
            h = `${h}`.toUpperCase(), h == "4326" || h == "EPSG4326" || h == "EPSG:4326" || h == "WGS84" ? e.tilingScheme = new l.GeographicTilingScheme({
              numberOfLevelZeroTilesX: r.numberOfLevelZeroTilesX || 2,
              numberOfLevelZeroTilesY: r.numberOfLevelZeroTilesY || 1
            }) : h == "4490" || h == "EPSG4490" || h == "EPSG:4490" ? (e.tilingScheme = new l.GeographicTilingScheme({
              numberOfLevelZeroTilesX: r.numberOfLevelZeroTilesX || 2,
              numberOfLevelZeroTilesY: r.numberOfLevelZeroTilesY || 1
            }), e.is4490 = !0) : e.tilingScheme = new l.WebMercatorTilingScheme({
              numberOfLevelZeroTilesX: r.numberOfLevelZeroTilesX || 1,
              numberOfLevelZeroTilesY: r.numberOfLevelZeroTilesY || 1
            });
            break;
          case "rectangle":
            e.rectangle = l.Rectangle.fromDegrees(h.xmin, h.ymin, h.xmax, h.ymax);
            break
        }
      }
      if (e.chinaCrs === "GCJ02" && (e.tilingScheme = new Js), e.chinaCrs === "BD09") {
        let c = [];
        for (let h = 0; h < 19; h++) c[h] = 256 * Math.pow(2, 18 - h);
        e.tilingScheme = new Ks({
          resolutions: c,
          rectangleSouthwestInMeters: new l.Cartesian2(-2003772637e-2, -1247410417e-2),
          rectangleNortheastInMeters: new l.Cartesian2(2003772637e-2, 1247410417e-2)
        })
      }
      e.crs = (o = e.crs) != null ? o : "WGS84", e.style = (a = e.style) != null ? a : e.layer, e.is4490 && e.url && (e.url = e.url.replace("{z}", "{z4490}"), e.url = e.url.replace("{arc_z}", "{arc_z4490}"), e.url = e.url.replace("{arc_Z}", "{arc_Z4490}"));
      let i, n;
      switch (e.type_new || e.type) {
        case "single":
        case "image":
          i = new l.SingleTileImageryProvider(e);
          break;
        case "xyz":
        case "tile":
          e.customTags = e.customTags || {}, e.customTags["z&1"] = function (c, h, u, d) {
            return d + 1
          }, e.customTags.z4490 = function (c, h, u, d) {
            return d + 1
          }, i = new l.UrlTemplateImageryProvider(e);
          break;
        case "wms":
          i = new l.WebMapServiceImageryProvider(e);
          break;
        case "tms":
          e.url || (e.url = l.buildModuleUrl("Assets/Textures/NaturalEarthII")), i = new l.TileMapServiceImageryProvider(e);
          break;
        case "wmts":
          i = new l.WebMapTileServiceImageryProvider(e);
          break;
        case "gee":
          i = new l.GoogleEarthEnterpriseImageryProvider({
            metadata: new l.GoogleEarthEnterpriseMetadata(e)
          });
          break;
        case "mapbox":
          i = new l.MapboxImageryProvider(e);
          break;
        case "mapboxstyle":
          i = new l.MapboxStyleImageryProvider(e);
          break;
        case "arcgis":
        case "arcgis_tile":
        case "arcgis_dynamic":
          i = new l.ArcGisMapServerImageryProvider(e);
          break;
        case "sm_img":
        case "supermap_img":
          i = new Ip(e);
          break;
        case "arcgis_cache":
          l.UrlTemplateImageryProvider.prototype.padLeft0 || (l.UrlTemplateImageryProvider.prototype.padLeft0 = function (c, h) {
            c = String(c);
            let u = c.length;
            for (; u < h;) c = `0${c}`, u++;
            return c
          }), e.customTags = {
            arc_x: function (h, u, d, p) {
              return h.padLeft0(u.toString(16), 8)
            },
            arc_y: function (h, u, d, p) {
              return h.padLeft0(d.toString(16), 8)
            },
            arc_z: function (h, u, d, p) {
              return h.padLeft0(p.toString(), 2)
            },
            arc_z4490: function (h, u, d, p) {
              return h.padLeft0((p + 1).toString(), 2)
            },
            arc_X: function (h, u, d, p) {
              return h.padLeft0(u.toString(16), 8).toUpperCase()
            },
            arc_Y: function (h, u, d, p) {
              return h.padLeft0(d.toString(16), 8).toUpperCase()
            },
            arc_Z: function (h, u, d, p) {
              return h.padLeft0(p.toString(), 2).toUpperCase()
            },
            arc_Z4490: function (h, u, d, p) {
              return h.padLeft0((p + 1).toString(), 2).toUpperCase()
            }
          }, i = new l.UrlTemplateImageryProvider(e);
          break;
        case "tdt":
          e.key = et.tianditu, i = new l.TdtImageryProvider(e);
          break;
        case "gaode":
          i = new l.AmapImageryProvider(e);
          break;
        case "baidu":
          i = new l.BaiduImageryProvider(e);
          break;
        case "google":
          if (r.crs == "4326" || r.crs == "wgs84") switch (e.layer) {
            default:
            case "img_d":
              n = "https://www.google.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}";
              break
          } else switch (e.layer) {
            case "vec":
            default:
              n = "https://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile";
              break;
            case "img_d":
              n = "https://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&gl=CN&x={x}&y={y}&z={z}&s=Gali";
              break;
            case "img_z":
              n = "https://mt{s}.google.cn/vt/imgtp=png32&lyrs=h@207000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galil";
              break;
            case "ter":
              n = "https://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile";
              break
          }
          i = new l.UrlTemplateImageryProvider({
            url: n,
            subdomains: ["1", "2", "3"],
            maximumLevel: 20
          });
          break;
        case "osm":
          n = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", i = new l.UrlTemplateImageryProvider({
            url: n,
            subdomains: "abc",
            maximumLevel: 18
          });
          break;
        case "bing":
          n = "https://dev.virtualearth.net";
          var s = e.layer || l.BingMapsStyle.Aerial;
          i = new l.BingMapsImageryProvider({
            url: n,
            key: e.key || "AtkX3zhnRe5fyGuLU30uZw8r3sxdBDnpQly7KfFTCB2rGlDgXBG3yr-qEiQEicEc",
            mapStyle: s
          });
          break;
        case "custom_grid":
          e.cells = e.cells || 2, e.color = l.Color.fromCssColorString(e.color || "rgba(255,255,255,1)"), e.glowWidth = e.glowWidth || 3, e.glowColor ? e.glowColor = l.Color.fromCssColorString(e.glowColor) : e.glowColor = e.color.withAlpha(.3), e.backgroundColor = l.Color.fromCssColorString(e.backgroundColor || "rgba(0,0,0,0)"), i = new l.GridImageryProvider(e);
          break;
        case "custom_tilecoord":
          i = new l.TileCoordinatesImageryProvider(e);
          break;
        case "custom_featuregrid":
          i = new Dp(e);
          break;
        case "grid":
          i = new l.GridImageryProvider(Rp(e));
          break;
        default:
          console.log("config\u914D\u7F6E\u56FE\u5C42\u672A\u5904\u7406:", r);
          break
      }
      if (i && (i.config = e), e.chinaCrs === "BD09" && e.type !== "baidu") {
        i._rectangle = e.tilingScheme.rectangle;
        const c = i.requestImage;
        i.requestImage = function (h, u, d) {
          return c.call(this, h, -u, d)
        }
      }
      return U(e.show) && (i.show = e.show), i
    },
    hideBaseMap(r) {
      this.getImageryLayersById(r).forEach(e => {
        e.show = !1
      })
    },
    showBaseMap(r) {
      const e = this.getImageryLayersById(r);
      if (!e.length) {
        if (this.options.baseLayerPicker) {
          const i = this.viewer.baseLayerPicker.viewModel.imageryProviderViewModels.find(n => n.id === r);
          i && (this.viewer.baseLayerPicker.viewModel.selectedImagery = i), this._currentMapId = r, console.log(`\u5F53\u524D\u5730\u56FE\u4E3A ${this._currentMapId}`), this.fire("currentMapIdChange", r)
        } else {
          const i = this.options.baseMaps.find(n => n.id === r);
          i && this.addBaseMap(i)
        }
        return
      }
      e.forEach(i => {
        i.show = !0
      })
    },
    removeBaseMap(r) {
      const e = this.getImageryLayersById(r);
      !e || e.forEach(i => {
        this.viewer.imageryLayers.remove(i)
      })
    }
  };

  function Rp(r) {
    const e = {};
    for (const i in r) i.endsWith("Color") || i.endsWith("color") ? e[i] = r[i] instanceof l.Color ? r[i] : l.Color.fromCssColorString(r[i]) : e[i] = r[i];
    return e
  }
  const ot = {
    Ready: "ready",
    Start: "Start",
    End: "End"
  };
  class at extends Dt {
    constructor(n) {
      var s = n,
        {
          map: e
        } = s,
        i = re(s, ["map"]);
      super();
      P(this, "graphic", null);
      P(this, "mousePoint", null);
      this.options = i, this._map = e, this.points = [], this._initGraphic(), this.state = ot.Ready, this.toolTipMessage = ye(this.constructor.toolTipMessage, this.options.toolTipMessage)
    }
    get drawPoints() {
      return this.points.concat(this.state === ot.Start ? this.mousePoint : null).filter(Boolean)
    }
    updateToolTip() {
      const {
        minPointNum: e,
        maxPointNum: i
      } = this.options, n = this.points.length;
      if (n + 1 === i) {
        this.tooltip = this.toolTipMessage.startThenEnd;
        return
      }
      if (n === 0) {
        this.tooltip = this.toolTipMessage.start;
        return
      }
      if (n >= e - 1) {
        this.tooltip = this.toolTipMessage.end;
        return
      }
      if (n < e) {
        this.tooltip = this.toolTipMessage.pending;
        return
      }
      this.tooltip = ""
    }
    set tooltip(e) {
      this._map.tooltip.text = e
    }
    _initGraphic() {}
    start() {
      if (this.state === ot.Start) return console.log("\u5DF2\u5904\u4E8Estart\u72B6\u6001"), Promise.reject();
      this.state = ot.Start, this.fire("drawStart", {
        target: this.graphic
      }), this.setCrosshairCursor(!0), this.updateToolTip();
      let e;
      return this.drawEventEffect = [this._map.on("click", i => {
        const n = i.point;
        !n || (e = setTimeout(() => {
          this.state !== ot.End && (this.points.push(n), this.updateToolTip(), this.mousePoint = null, this.fire("drawPoint", {
            point: n,
            points: this.points,
            target: this.graphic
          }), this.points.length >= this.options.maxPointNum && this.end())
        }, 0))
      }), this._map.on("rClick", () => {
        if (!this.points.length) return;
        const i = this.points.pop();
        this.updateToolTip(), this.fire("drawRemovePoint", {
          points: this.points,
          target: this.graphic,
          point: i
        })
      }), this._map.on("mousemove", i => {
        const n = i.point;
        !n || (this.mousePoint = n)
      }), this._map.on("dbClick", () => {
        e && (clearTimeout(e), e = null), this.end()
      })], new Promise((i, n) => {
        this.once("drawEnd drawCancel", (s, o) => {
          o === "drawEnd" && i(s), o === "drawCancel" && n("\u53D6\u6D88\u7ED8\u5236")
        })
      })
    }
    end() {
      if (this.state !== ot.Start) {
        console.log("\u6267\u884Cdraw end\u65F6\uFF0C\u672A\u5904\u4E8Estart\u72B6\u6001");
        return
      }
      this.state = ot.End, this.drawEventEffect.forEach(s => s()), this.drawEventEffect = [], this.setCrosshairCursor(!1);
      const {
        minPointNum: e,
        maxPointNum: i
      } = this.options;
      this.mousePoint = null;
      const n = this.points.length;
      this.tooltip = "", n >= e && n <= i ? (this.fire("drawEnd", {
        points: this.points,
        target: this.graphic
      }), this.fire("drawEndDone", {
        points: this.points,
        target: this.graphic
      })) : this.fire("drawCancel", {
        points: this.points,
        target: this.graphic
      })
    }
    setCrosshairCursor(e) {
      this._map.setCursor(e ? "crosshair" : "")
    }
    destroy() {
      this.state !== ot.End && (console.log("destroy \u4E4B\u524D \u672A\u5904\u4E8Eend\u72B6\u6001"), this.end()), this._map = null, this.options = null, this.graphic = null, super.destroy()
    }
  }
  P(at, "toolTipMessage", {
    startThenEnd: "\u5355\u51FB \u5B8C\u6210\u7ED8\u5236",
    start: "\u5355\u51FB \u5F00\u59CB\u7ED8\u5236",
    pending: "\u5355\u51FB\u589E\u52A0\u70B9\uFF0C\u53F3\u51FB\u5220\u9664\u70B9",
    end: "\u5355\u51FB\u589E\u52A0\u70B9\uFF0C\u53F3\u51FB\u5220\u9664\u70B9<br/>\u53CC\u51FB\u5B8C\u6210\u7ED8\u5236"
  });
  class qr extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Billboard);
      P(this, "resourceStyleFields", ["image", "url"]);
      e.primitive ? this.primitive = {
        show: this.visible
      } : this.entity = new l.Entity({
        billboard: {},
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }
  class Zs extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Model);
      P(this, "resourceStyleFields", ["url", "uri"]);
      e.primitive ? this.primitive = l.Model.fromGltf({
        url: e.style.url || e.style.uri
      }) : this.entity = new l.Entity({
        show: this.visible
      })
    }
    getBoxSize() {
      if (!l.ModelUtility.getPositionMinMax || !this.entity || !this._map) return;
      const e = this.entity;
      let i = this._map.viewer.dataSourceDisplay._defaultDataSource;
      if (!i.entities.contains(e)) {
        i = void 0;
        const d = this._map.viewer.dataSourceDisplay._dataSourceCollection,
          p = d.length;
        for (let f = 0; f < p; f++) {
          const m = d.get(f);
          if (m.entities.contains(e)) {
            i = m;
            break
          }
        }
      }
      let n;
      for (let d = 0; d < i._visualizers.length; d++) {
        const p = i._visualizers[d];
        if (p instanceof l.ModelVisualizer) {
          const f = p._modelHash[e.id];
          f && (n = f)
        }
      }
      if (!n) return;
      console.log("model", n);
      let s = new l.Cartesian3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),
        o = new l.Cartesian3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
      const a = new l.Cartesian3,
        c = new l.Cartesian3,
        h = n.modelPrimitive.loader.components.nodes.map(d => d.primitives).flat(),
        u = h.length;
      for (let d = 0; d < u; ++d) {
        const p = h[d].attributes.find(f => f.name === "POSITION");
        if (p) {
          const f = p;
          if (f.min && f.max) {
            const m = l.Cartesian3.clone(f.min, a),
              g = l.Cartesian3.clone(f.max, c);
            l.Cartesian3.minimumByComponent(s, m, s), l.Cartesian3.maximumByComponent(o, g, o)
          }
        }
      }
      return {
        x: o.x - s.x,
        y: o.y - s.y,
        z: o.z - s.z
      }
    }
    _updatePosition() {
      super._updatePosition(), this.primitive && (this.primitive.modelMatrix = l.Transforms.eastNorthUpToFixedFrame(this.point))
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }
  var Bp = "";
  class Lp {
    constructor() {
      this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d")
    }
    _formatExtend(e) {
      if (ap(e)) return new Array(4).fill(e);
      if (Ie(e)) {
        const [i, n = i, s = i, o = n] = e;
        return [i, n, s, o]
      }
      return new Array(4).fill(0)
    }
    _getBoundingRectanglePoints({
      x: e,
      y: i,
      width: n,
      height: s
    }, o) {
      const [a, c, h, u] = this._formatExtend(o);
      return {
        points: [
          [e + n / 2, i + s / 2],
          [e - u, i - a],
          [e - u, i + s + h - 1],
          [e + n + c - 1, i - a],
          [e + n + c, i + s + h - 1]
        ],
        boundingRectangle: {
          x: e - u,
          y: i - a,
          width: n + u + c,
          height: s + a + h
        }
      }
    }
    insert(e, i) {
      const {
        points: n,
        boundingRectangle: s
      } = this._getBoundingRectanglePoints(e, i), o = n.every(([a, c]) => this.ctx.getImageData(a, c, 1, 1).data[3] !== 255);
      return o && (this.ctx.fillStyle = "#000000", this.ctx.fillRect(s.x, s.y, s.width, s.height), this.ctx.fillStyle = "#FF0000", n.forEach(a => {
        this.ctx.fillRect(a[0], a[1], 1, 1)
      })), o
    }
    clear() {
      const e = document.body.clientWidth,
        i = document.body.clientHeight;
      this.canvas.width = e, this.canvas.height = i, this.ctx.clearRect(0, 0, e, i)
    }
    destroy() {
      this.canvas = null, this.ctx = null
    }
  }

  function Gp(r, {
    className: e,
    style: i,
    attribute: n,
    event: s,
    container: o,
    child: a
  } = {}) {
    const c = document.createElement(r);
    return e && Up(c, e), i && pe(c, i), n && Hp(c, n), s && Fp(c, s), o && o.appendChild(c), a && (c.innerHTML = "", Re(a) ? c.innerHTML = a : Ie(a) ? a.forEach(h => {
      c.appendChild(h)
    }) : c.appendChild(a)), c
  }

  function Fp(r, e) {
    Object.keys(e).forEach(i => {
      $t(r, i, e[i])
    })
  }

  function Hp(r, e) {
    Object.keys(e).forEach(i => {
      r.setAttribute(i, e[i])
    })
  }

  function eo(r) {
    return typeof HTMLElement == "object" ? r instanceof HTMLElement : !!(r && typeof r == "object" && (r.nodeType === 1 || r.nodeType === 9) && typeof r.nodeName == "string")
  }

  function Np(r, e) {
    let i = r.className,
      n = i.split(/\s+/);
    for (let s = 0; s < n.length; s++)
      if (n[s] == e) return !0;
    return !1
  }

  function pe(r, e) {
    Object.keys(e).forEach(i => {
      r.style[i] = e[i]
    })
  }

  function Up(r, e) {
    if (Np(r, e)) return;
    const i = r.className,
      n = i != "" ? " " : "",
      s = i + n + e;
    r.className = s
  }
  const to = function (r, e, i) {
      const n = window.document.createElement(r);
      return e && (n.className = e), i && i.appendChild(n), n
    },
    io = window.document ? window.document.documentElement.style : null;

  function ro(r) {
    if (!io) return null;
    for (let e = 0; e < r.length; e++)
      if (r[e] in io) return r[e];
    return r[0]
  }
  ro(["userSelect", "MozUserSelect", "WebkitUserSelect", "msUserSelect"]), ro(["transform", "WebkitTransform"]);
  const $t = function (r, e, i, n) {
      if (!(!r || !e || !i)) return n = n || {}, r.addEventListener(e, i, n.capture), () => {
        Vp(r, e, i, n)
      }
    },
    Vp = function (r, e, i, n) {
      !r || !e || !i || (n = n || {}, r.removeEventListener(e, i, n.capture))
    };
  class Wp {
    constructor(e, i) {
      P(this, "options", {
        triggerEvents: ["cameraMoveEnd", "cameraChanged"],
        label: !0,
        point: !0,
        billboard: !0
      });
      this.dataSource = e, this._map = i, this.avoidTest = new Lp, this._resizeCancel = $t(window, "resize", () => {
        this.update()
      })
    }
    setOptions(e) {
      this.options = ye(this.options, e), this.update(), this._cancels && (this._cancels.forEach(i => i()), this._cancels = null), this._cancels = this.options.triggerEvents.map(i => this._map.on(i, () => {
        this.update()
      }))
    }
    update() {
      this.avoidTest.clear(), this._getPrimitives().forEach(i => {
        const n = this.avoidTest.insert(i.boundingSphere, this.options.extend);
        i.primitive.clusterShow = n, i.label && (i.label.clusterShow = n)
      })
    }
    _getPrimitives() {
      const e = [],
        i = this.dataSource._entityCluster;
      if (this.options.billboard && i._billboardCollection)
        for (let n = 0; n < i._billboardCollection.length; n++) {
          const s = i._billboardCollection.get(n),
            o = s.computeScreenSpacePosition(this._map.scene);
          if (!o) continue;
          const a = {
            primitive: s,
            boundingSphere: l.Billboard.getScreenSpaceBoundingBox(s, o)
          };
          i._labelCollection && (a.label = i._labelCollection._labels.find(c => c.id === s.id)), e.push(a)
        }
      if (this.options.point && i._pointCollection)
        for (let n = 0; n < i._pointCollection.length; n++) {
          const s = i._pointCollection.get(n),
            o = s.computeScreenSpacePosition(this._map.scene);
          if (!o) continue;
          const a = {
            primitive: s,
            boundingSphere: l.PointPrimitive.getScreenSpaceBoundingBox(s, o)
          };
          i._labelCollection && (a.label = i._labelCollection._labels.find(c => c.id === s.id)), e.push(a)
        }
      if (this.options.label && i._labelCollection)
        for (let n = 0; n < i._labelCollection.length; n++) {
          const s = i._labelCollection.get(n);
          if (e.find(a => a.label === s)) continue;
          const o = s.computeScreenSpacePosition(this._map.scene);
          !o || e.push({
            primitive: s,
            boundingSphere: l.Label.getScreenSpaceBoundingBox(s, o)
          })
        }
      return e
    }
    destroy() {
      this.dataSource && (this._getPrimitives().forEach(i => {
        i.primitive.clusterShow = !0
      }), this.dataSource = null), this.avoidTest && (this.avoidTest.destroy(), this.avoidTest = null), this._resizeCancel && (this._resizeCancel(), this._resizeCancel = null), this._cancels && (this._cancels.map(e => e()), this.cancel = null), this._map && (this._map = null)
    }
  }
  class pt extends it {
    constructor(e = {}) {
      const {
        id: i = Kt(),
        graphics: n,
        clustering: s,
        avoid: o,
        attr: a,
        visible: c = !0
      } = e;
      super();
      P(this, "type", G.Group);
      P(this, "options", {});
      P(this, "graphics", []);
      P(this, "_dataSourceCollection", []);
      this.options = e, this.id = i, this.visible = c, this.primitive = new l.PrimitiveCollection, this.dataSource = new l.CustomDataSource, this.dataSource._groupGraphic = this, this.billboardCollection = new l.BillboardCollection, this.primitive.add(this.billboardCollection), this.labelCollection = new l.LabelCollection, this.primitive.add(this.labelCollection), this.polylineCollection = new l.PolylineCollection, this.primitive.add(this.polylineCollection), this.pointPrimitiveCollection = new l.PointPrimitiveCollection, this.primitive.add(this.pointPrimitiveCollection), n && n.length && n.forEach(this.addGraphic.bind(this)), U(s) && this.setClustering(s), U(o) && this.setAvoid(o), a && (this.attr = a), this.visible === !1 && this.hide()
    }
    get attr() {
      return this.options.attr || {}
    }
    set attr(e) {
      this.options.attr = e || {}
    }
    setAttr(e) {
      U(e) && (this.options.attr = ne(this.attr, e))
    }
    avoidUpdate() {
      this._avoid && this._avoid.update()
    }
    async setAvoid(e) {
      if (!ce(e)) {
        if (this._map || await new Promise(i => {
            this.once("addToMap", i)
          }), Ns(e) && (e = {
            enabled: e
          }), e.enabled) {
          this._avoid || (this._avoid = new Wp(this.dataSource, this._map)), this._avoid.setOptions(e);
          return
        }
        this._avoid && (this._avoid.destroy(), this._avoid = null)
      }
    }
    setClustering(e) {
      if (ce(e)) return;
      Ns(e) && (e = {
        enabled: e
      });
      const o = e,
        {
          enabled: i = !0,
          style: n = a => ({
            billboard: {
              show: !0,
              image: Bp,
              verticalOrigin: "CENTER",
              width: 40,
              height: 40,
              eyeOffset: [0, 0, -100]
            },
            label: {
              text: `${a>99?"99+":a}`,
              fontSize: 15,
              verticalOrigin: "CENTER",
              horizontalOrigin: "CENTER",
              visibleDepth: !1
            }
          })
        } = o,
        s = re(o, ["enabled", "style"]);
      this._clustringRemoveListener && this._clustringRemoveListener(), this._clustringRemoveListener = this.dataSource.clustering.clusterEvent.addEventListener((a, c) => {
        c.billboard.attr = {
          isCluster: !0
        }, c.label.attr = {
          isCluster: !0
        }, c.point.attr = {
          isCluster: !0
        };
        const {
          billboard: h,
          label: u,
          point: d
        } = n(a.length, a, c);
        h && Ue(c.billboard, Ae(h, G.Billboard)), u && Ue(c.label, Ae(u, G.Label)), d && Ue(c.point, Ae(d, G.Point))
      }), this.dataSource.clustering.enabled = i, Ue(this.dataSource.clustering, s)
    }
    _addedHook() {
      super._addedHook(), this.graphics.forEach(e => {
        e._onAddToMap(this._map)
      }), this.once("destroy", this._map.on("click", e => {
        var i, n;
        ((n = (i = e.target) == null ? void 0 : i.attr) == null ? void 0 : n.isCluster) && this.fire("cluster-click", e)
      })), this.fire("addToMap")
    }
    addTo(e) {
      return e.addGraphic(this), this
    }
    addGraphics(e) {
      return e.map(i => this.addGraphic(i))
    }
    get ContainerMap() {
      return {
        [G.Billboard]: this.billboardCollection,
        [G.Label]: this.labelCollection,
        [G.Point]: this.pointPrimitiveCollection,
        [G.Polyline]: this.polylineCollection
      }
    }
    addGraphic(e) {
      if (Oe(e) && (e = e(this)), e._parent && console.warn("graphic \u5DF2\u5B58\u5728 parent", e), e instanceof Array) return e.map(n => this.addGraphic(n));
      if (!(e instanceof it)) {
        const i = e,
          {
            type: n,
            on: s
          } = i,
          o = re(i, ["type", "on"]),
          a = Hi[n];
        if (!a) {
          console.warn(`\u4E0D\u5B58\u5728type\u4E3A${n}\u7684graphic`);
          return
        }
        e = new a(o), s && Object.entries(s).forEach(([c, h]) => {
          e.on(c, h)
        })
      }
      if (e.entity && this.dataSource.entities.add(e.entity), e.primitive) {
        const n = this.ContainerMap[e.type] || this.primitive;
        e.loadPromise ? e.loadPromise.then(() => {
          e.primitive = n.add(e.primitive)
        }) : e.primitive = n.add(e.primitive)
      }
      return e.dataSource && (this._map ? this._map.viewer.dataSources.add(e.dataSource) : this.once("addToMap", () => {
        this._map.viewer.dataSources.add(e.dataSource)
      }), this._dataSourceCollection.push(e.dataSource), e.dataSource.show = this.isRealVisible), this.graphics.push(e), this.state === me.ADDED && e._onAddToMap(this._map), e._parent = this, e
    }
    removeGraphic(e) {
      if (e instanceof Array) {
        e.forEach(n => {
          this.removeGraphic(n)
        });
        return
      }
      e instanceof it || (e = this.getGraphic(e));
      const i = this.graphics.findIndex(n => n === e);
      if (i !== -1) {
        if (e.entity && this.dataSource.entities.remove(e.entity), e.primitive && (this.ContainerMap[e.type] || this.primitive).remove(e.primitive), e.dataSource) {
          this._map && this._map.viewer.dataSources.remove(e.dataSource);
          const n = this._dataSourceCollection.find(s => s === e.dataSource);
          n !== -1 && this._dataSourceCollection.splice(n, 1)
        }
        this.graphics.splice(i, 1), [me.DESTROYED, me.REMOVED].includes(e.state) || e.destroy()
      }
    }
    getAllGraphics() {
      return Nr("graphics", this)
    }
    getGraphic(e) {
      return Vr("graphics", this, i => i.id === e)
    }
    show() {
      this.dataSource.show = !0, this.primitive.show = !0, this.visible = !0, this._updateVisible()
    }
    hide() {
      this.dataSource.show = !1, this.primitive.show = !1, this.visible = !1, this._updateVisible()
    }
    _updateVisible() {
      this.dataSource.show = this.isRealVisible, this.graphics.forEach(e => {
        var i;
        (i = e._updateVisible) == null || i.call(e)
      })
    }
    get isRealVisible() {
      let e = this,
        i = !0;
      for (; e;) !ce(e.visible) && !e.visible && (i = !1), e = e._parent;
      return i
    }
    destroy() {
      [...this.graphics].forEach(e => {
        e.destroy()
      }), this._parent && this._parent.removeGraphic(this), this._clustringRemoveListener && this._clustringRemoveListener(), this._dataSourceCollection && (this._dataSourceCollection = null)
    }
    removeAllGraphic() {
      [...this.graphics].forEach(e => {
        e.destroy()
      })
    }
    toGeoJson() {
      return {
        type: "FeatureCollection",
        features: this.graphics.map(e => {
          var i;
          return (i = e.toGeoJson) == null ? void 0 : i.call(e)
        }).filter(Boolean)
      }
    }
    async loadGeoJson(e, i) {
      let n = [];
      if (Re(e)) try {
        n = await l.Resource.fetchJson({
          url: e
        })
      } catch (s) {
        console.warn(s), n = []
      }
      return ge(e) && (n = e), this.loadFeature(n, i)
    }
    loadFeature(e, i = {}) {
      var h, u, d;
      if (!e) return;
      if (Ie(e)) return e.map(p => this.loadFeature(p, i));
      if (!ge(e)) return;
      if (e.type === "FeatureCollection") return e.features.map(p => this.loadFeature(p, i));
      if (e.type !== "Feature") return;
      const {
        geometry: {
          type: n,
          coordinates: s
        } = {},
        properties: o = {}
      } = e, a = i.onCreateGraphic || ((p, f) => f);
      let c = [];
      return n === "Point" && (Ue(o, i.point), c.push(a({
        type: n,
        coordinates: s,
        properties: o
      }, {
        type: (h = o.type) != null ? h : "point",
        attr: o.attr,
        position: s,
        style: o.style
      }))), n === "MultiPoint" && (Ue(o, i.point), c = s.map(p => {
        var f;
        return a({
          type: n,
          coordinates: p,
          properties: o,
          group: this
        }, {
          type: (f = o.type) != null ? f : "point",
          attr: o.attr,
          position: p,
          style: o.style
        })
      })), n === "LineString" && (Ue(o, i.polyline), c.push(a({
        type: n,
        coordinates: s,
        properties: o
      }, {
        type: (u = o.type) != null ? u : "polyline",
        attr: o.attr,
        positions: s,
        style: o.style
      }))), n === "MultiLineString" && (Ue(o, i.polyline), c = s.map(p => {
        var f;
        return a({
          type: n,
          coordinates: p,
          properties: o,
          group: this
        }, {
          type: (f = o.type) != null ? f : "polyline",
          attr: o.attr,
          positions: p,
          style: o.style
        })
      })), n === "Polygon" && (Ue(o, i.polygon), c.push(a({
        type: n,
        coordinates: s,
        properties: o
      }, {
        type: (d = o.type) != null ? d : "polygon",
        attr: o.attr,
        positions: s[0].slice(0, -1),
        style: o.style
      }))), n === "MultiPolygon" && (Ue(o, i.polygon), c = s.map(p => {
        var f;
        return a({
          type: n,
          coordinates: p,
          properties: o,
          group: this
        }, {
          type: (f = o.type) != null ? f : "polygon",
          attr: o.attr,
          positions: p[0].slice(0, -1),
          style: o.style
        })
      })), this.addGraphics(c.filter(Boolean))
    }
    updateGraphics(e) {
      const {
        insert: i,
        remove: n,
        equal: s
      } = Oi(this.graphics, e, (o, a) => o.id === a.id);
      return i.forEach(o => {
        this.addGraphic(o)
      }), n.forEach(o => {
        this.removeGraphic(o)
      }), s.forEach(({
        oldVal: o,
        newVal: a
      }) => {
        if (a.type === G.Group) {
          o.updateGraphics(a.graphics);
          return
        }
        o.setOptions(a)
      }), this
    }
    async toJSON() {
      return {
        attr: this.attr,
        type: this.type,
        graphics: await Promise.all(this.graphics.map(e => e.toJSON()))
      }
    }
    toData() {
      return this.graphics.map(e => e.toData())
    }
    appendTo(e) {
      if (e === this) return;
      let i = this.state;
      this.state = me.REMOVED, this._parent && (this._parent.primitive.destroyPrimitives = !1, this._parent.removeGraphic(this), this._parent.primitive.destroyPrimitives = !0), e.addGraphic(this), this.state = i
    }
  }
  class no extends pt {
    constructor(e) {
      super(e);
      P(this, "type", G.RoamLine);
      this.options = e, this._bindFloorControl(), console.warn("RoamLineGraphic\u7C7B\u5C06\u5728\u4E0B\u4E00\u4E2A\u5927\u7248\u672C\u79FB\u9664\uFF0C\u8BF7\u4F7F\u7528AnimteGraphgic\u7C7B\u66FF\u6362")
    }
    _addedHook() {
      super._addedHook();
      const e = this._map,
        {
          autoplay: i = !0
        } = this.options.style,
        n = this.options;
      this._ani = new Ls(e, {
        speed: n.style.speed,
        duration: n.style.duration,
        loop: n.style.loop
      }), n.positions.forEach(o => {
        this.add(o)
      }), ["endItem", "end", "start", "update"].forEach(o => {
        this._ani.on(o, (...a) => {
          this.fire(o, ...a)
        })
      });
      const s = this;
      this.graphics.forEach(o => {
        o.position = this._ani.property, o.orientation = new Proxy(this._ani.orientation, {
          get(a, c) {
            return c === "getValue" ? function (h) {
              const u = jn(s._ani.property.getValue(h), Reflect.get(a, c).apply(this, arguments));
              return u.pitch = l.Math.toRadians(0), l.Transforms.headingPitchRollQuaternion(s._ani.property.getValue(h), u)
            } : Reflect.get(a, c)
          }
        })
      }), i && this.start()
    }
    _bindFloorControl() {
      const e = this.options.floorControl;
      e && (this.once("destroy", e.on("floorHeightChange", () => {
        this.refreshPosition()
      })), this.once("destroy", e.on("focusFloorChange", () => {
        this._refreshGraphicInBuilding(), this.refreshPosition()
      })), this.once("destroy", e.on("focusBuildingChange", () => {
        this._refreshGraphicInBuilding(), this.refreshPosition()
      })), this.on("endItem", () => {
        this._refreshGraphicInBuilding()
      }))
    }
    _refreshGraphicInBuilding() {
      var c, h, u, d, p, f;
      const e = this.options.floorControl;
      if (!e) return;
      const i = this.positions[this.currentIndex];
      if (!i) return;
      const {
        focusBuildingId: n,
        focusFloorId: s
      } = e, {
        buildingId: o,
        floor: a
      } = i;
      !o || o === n && (!s || s === a) ? ((c = this.model) == null || c.show(), (h = this.div) == null || h.show(), (u = this.billboard) == null || u.show()) : ((d = this.model) == null || d.hide(), (p = this.div) == null || p.hide(), (f = this.billboard) == null || f.hide())
    }
    add(e) {
      const i = this.options.floorControl;
      if (!i) return this._ani.add(e);
      const n = () => new R(e.value ? Oe(e.value) ? e.value() : e.value : e),
        s = {
          getValue() {
            let c = 0;
            if (s.buildingId && s.buildingId === i.focusBuildingId && e.floor && (c = (e.floor - 1) * i.floorHeight), !(i.focusFloorId && i.focusFloorId < e.floor)) return n().addHeight(c)
          },
          attr: e,
          floor: e.floor
        },
        o = n(),
        a = i.options.buildings.find(c => o.isInPolygon(c.buildingRegion.coordinates[0]));
      return a && (s.buildingId = a.id), this._ani.add(s)
    }
    restart() {
      var e;
      (e = this._ani) == null || e.restart()
    }
    start() {
      var e;
      (e = this._ani) == null || e.start()
    }
    pause() {
      var e;
      (e = this._ani) == null || e.pause()
    }
    proceed() {
      var e;
      (e = this._ani) == null || e.proceed()
    }
    get animateState() {
      var e;
      return (e = this._ani) == null ? void 0 : e.state
    }
    reset() {
      var e;
      (e = this._ani) == null || e.reset()
    }
    get positions() {
      var e;
      return (e = this._ani) == null ? void 0 : e.positions
    }
    get currentIndex() {
      var e;
      return (e = this._ani) == null ? void 0 : e.currentIndex
    }
    refreshPosition(...e) {
      var i;
      return (i = this._ani) == null ? void 0 : i.refreshPosition(...e)
    }
  }
  class Qr extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.DivPoint);
      P(this, "_forceUpdate", !1);
      this._init(), e.primitive || (this.entity = new l.Entity({
        show: this.visible,
        point: {}
      }))
    }
    _updatePosition() {
      if (this.style.clampToTerrain) {
        this.clampToTerrain();
        return
      }
      super._updatePosition()
    }
    _addedHook() {
      super._addedHook();
      const e = this._map;
      e.viewer.container.appendChild(this._dom), this.once("destroy", () => {
        this._map.viewer.container.removeChild(this._dom)
      }), this.once("destroy", e.on("preRender", this.postRenderHandler.bind(this)))
    }
    setStyle(e, i = this.type) {
      this.options.style = ne(this.options.style, e), this.graphicStyle = Ae(this.options.style, i);
      const {
        html: n,
        hasEvent: s = !1,
        zIndex: o
      } = this.graphicStyle, a = this._dom;
      eo(n) ? (a.innerHTML = "", a.appendChild(n)) : a.innerHTML = n, pe(a, {
        position: "absolute",
        left: 0,
        top: 0,
        zIndex: o,
        "pointer-events": s ? "auto" : "none"
      });
      const {
        clampToGround: c,
        addHeight: h,
        setHeight: u
      } = e;
      Xt([c, h, u]) && this._updatePosition(), this.render()
    }
    render() {
      var v, b, C, M;
      const e = this._map.viewer.scene,
        i = this._map.viewer.camera,
        n = this.point,
        {
          depthTest: s = !0
        } = this.graphicStyle;
      if (!n) {
        pe(this._dom, {
          display: "none"
        });
        return
      }
      if (s && e.mode === l.SceneMode.SCENE3D) {
        const H = new l.EllipsoidalOccluder(e.globe.ellipsoid, e.camera.positionWC).isPointVisible(n);
        pe(this._dom, {
          display: H ? "block" : "none"
        })
      }
      const o = l.SceneTransforms.wgs84ToWindowCoordinates(e, n),
        a = e.mode === l.SceneMode.SCENE3D ? l.Cartesian3.distance(n, i.positionWC) : i.positionCartographic.height;
      if (!o || this.graphicStyle.distanceDisplayCondition && (this.graphicStyle.distanceDisplayCondition.near > a || this.graphicStyle.distanceDisplayCondition.far < a)) {
        pe(this._dom, {
          display: "none"
        });
        return
      }
      if (!o) return;
      const c = this._dom.offsetHeight,
        h = this._dom.offsetWidth;
      let u = o.x,
        d = o.y;
      const {
        horizontalOrigin: p,
        verticalOrigin: f,
        pixelOffset: m
      } = this.graphicStyle, g = {
        [l.HorizontalOrigin.LEFT]: {
          handler: S => S,
          axis: "left"
        },
        [l.HorizontalOrigin.CENTER]: {
          handler: S => S - h / 2,
          axis: "center"
        },
        [l.HorizontalOrigin.RIGHT]: {
          handler: S => S - h,
          axis: "right"
        }
      }, y = {
        [l.VerticalOrigin.CENTER]: {
          handler: S => S - c / 2,
          axis: "center"
        },
        [l.VerticalOrigin.TOP]: {
          handler: S => S,
          axis: "top"
        },
        [l.VerticalOrigin.BOTTOM]: {
          handler: S => S - c,
          axis: "bottom"
        },
        [l.VerticalOrigin.BASELINE]: {
          handler: S => S - c,
          axis: "bottom"
        }
      };
      if (u = (b = (v = g[p]) == null ? void 0 : v.handler(u)) != null ? b : u, d = (M = (C = y[f]) == null ? void 0 : C.handler(d)) != null ? M : d, m) {
        const {
          x: S = 0,
          y: H = 0
        } = m;
        u += S, d += H
      }
      let x = this.graphicStyle.scale;
      if (this.graphicStyle.scaleByDistance) {
        const S = this.graphicStyle.scaleByDistance;
        a <= S.near ? x *= S.nearValue : a > S.near && a < S.far ? x *= S.nearValue + (S.farValue - S.nearValue) * (a - S.near) / (S.far - S.near) : x *= S.farValue
      }
      const A = `matrix(${x},0,0,${x},${u},${d})`,
        _ = [g[p].axis, y[f].axis].join(" ");
      this._map.once("postRender", () => {
        pe(this._dom, {
          transform: A,
          "transform-origin": _,
          "-ms-transform": A,
          "-ms-transform-origin": _,
          "-webkit-transform": A,
          "-webkit-transform-origin": _,
          "-moz-transform": A,
          "-moz-transform-origin": _,
          "-o-transform": A,
          "-o-transform-origin": _
        })
      })
    }
    postRenderHandler({
      camera: e
    }) {
      if (!this.visible || !this.point || !this.isRealVisible) {
        pe(this._dom, {
          display: "none"
        });
        return
      }
      const i = this.point,
        n = [this._map.viewer.container.clientWidth, this._map.viewer.container.clientHeight, i.x, i.y, i.z, e.positionWC.x, e.positionWC.y, e.positionWC.z, e.heading, e.pitch, e.roll].join("-");
      n !== this._camera_cache && (this._camera_cache = n, this.render())
    }
    _init() {
      this._dom = to("div")
    }
    addTo(e) {
      return e.addGraphic(this), this
    }
    show() {
      this._dom && (this.visible = !0, pe(this._dom, {
        display: "block"
      }))
    }
    hide() {
      this._dom && (this.visible = !1, pe(this._dom, {
        display: "none"
      }))
    }
    set text(e) {
      this.setStyle({
        html: `<div style="background: rgba(0,0,0,.8);border-radius: 3px;padding:2px 6px;font-size:10px;color: #fff;">${e}</div>`
      })
    }
    async toJSON() {
      const e = await super.toJSON(),
        i = l.buildModuleUrl("../plugin/html2canvas.esm.js"),
        {
          default: n
        } = await import(i),
        s = await n(this._dom, {
          allowTaint: !0,
          backgroundColor: null
        });
      return e.style.html = `<img src="${s.toDataURL()}"/>`, e.style.hasEvent = !1, e
    }
  }
  const ft = function (r) {
    if (!l.defined(r) || r.length < 2) return 0;
    let e = 0;
    for (let i = 1, n = r.length; i < n; i++) e += l.Cartesian3.distance(r[i - 1], r[i]);
    return e
  };

  function jp(r, e) {
    let i = l.Rectangle.fromCartesianArray(r),
      n = Math.max(i.height, i.width);
    return n /= l.defaultValue(e, 10), n
  }

  function qp(r) {
    let e = r.positions,
      i = r.scene,
      n = jp(e, r.splitNum || 100);
    n <= 0 && (n = null);
    let s = l.PolylinePipeline.generateArc({
        positions: e,
        height: r.height,
        minDistance: r.minDistance,
        granularity: n
      }),
      o = [];
    for (let a = 0; a < s.length; a += 3) {
      let c = l.Cartesian3.unpack(s, a);
      if (i && l.defaultValue(r.surfaceHeight, !0)) {
        let h = Qp(i, c, r),
          u = l.Cartographic.fromCartesian(c);
        c = l.Cartesian3.fromRadians(u.longitude, u.latitude, h)
      }
      o.push(c)
    }
    return o
  }

  function Qp(r, e, i) {
    return r instanceof l.Viewer && (r = r.scene), i = i || {}, l.defaultValue(i.has3dtiles, l.defined(so(r, e))) ? dh(r, e, i) : Wn(r, e, i)
  }
  const Yp = {
    start: function (e) {
      this.params = e, this.scene = e.viewer ? e.viewer.scene : e.scene;
      let i = e.positions;
      if (i == null || i.length == 0) {
        this.end(i);
        return
      }
      if (this.positions = i, l.defaultValue(e.split, !0)) {
        i = qp({
          scene: this.scene,
          positions: i,
          height: e.height,
          minDistance: e.minDistance,
          surfaceHeight: e.splitSurfaceHeight,
          splitNum: l.defaultValue(e.splitNum, 100)
        });
        let a = [];
        for (let c = 0, h = i.length; c < h; ++c) a.push(i[c].clone());
        this.positions = a
      }
      let s = l.defaultValue(e.has3dtiles, l.defined(so(this.scene, i))),
        o = Xp(this.scene);
      if (this._has3dtiles = s, this._hasTerrain = o, !o && !s) {
        this.end(i);
        return
      }
      return o ? this.clampToTerrain(i) : this.clampTo3DTileset(i), this
    },
    clampToTerrain: function (e) {
      let i = this.scene.globe.ellipsoid,
        n = i.cartesianArrayToCartographicArray(e),
        s = l.Cartographic.fromCartesian(e[0]).height,
        o = this;
      l.when(l.sampleTerrainMostDetailed(this.scene.terrainProvider, n), a => {
        a = o.removeNullData(a);
        let c = !1,
          h = l.defaultValue(o.params.offset, 0);
        for (let d = 0; d < a.length; ++d) a[d].height == null ? (c = !0, a[d].height = s) : a[d].height = h + a[d].height;
        let u = i.cartographicArrayToCartesianArray(a);
        o._has3dtiles ? o.clampTo3DTileset(u) : o.end(u, c)
      })
    },
    clampTo3DTileset: function (e) {
      let i = this,
        n = [];
      for (let s = 0, o = e.length; s < o; ++s) n.push(e[s].clone());
      this.scene.clampToHeightMostDetailed(n).then(s => {
        s = i.removeNullData(s), s.length == 0 && (s = e), i.end(s)
      })
    },
    end: function (e, i) {
      this.params.calback && this.params.calback(e, i, this.positions)
    },
    removeNullData: function (e) {
      let i = [];
      for (let n = 0; n < e.length; ++n) e[n] != null && i.push(e[n]);
      return i
    }
  };

  function Xp(r) {
    return !!r.terrainProvider
  }

  function so(r, e) {
    if (!e) return null;
    r instanceof l.Viewer && (r = r.scene), e instanceof l.Cartesian3 && (e = [e]);
    for (let i = 0, n = e.length; i < n; ++i) {
      let s = e[i],
        o = l.SceneTransforms.wgs84ToWindowCoordinates(r, s);
      if (!l.defined(o)) continue;
      let a = r.pick(o, 10, 10);
      if (l.defined(a) && l.defined(a.primitive) && a.primitive instanceof l.Cesium3DTileset) return a.primitive
    }
    return null
  }

  function Kp(r) {
    let e = r.positions,
      i = {};
    for (let a in r) a == "positions" || a == "calback" || (i[a] = r[a]);
    let n = 0,
      s = e.length - 1;

    function o() {
      if (console.log({
          index: n,
          allcount: s
        }), n >= s) {
        console.log("done"), r.calbak && r.calbak(), r.calbakEnd && r.calbakEnd();
        return
      }
      i.positions = [e[n], e[n + 1]], i.calback = function (a, c) {
        r.calbakStep(a, c, n), n++, o()
      }, Yp.start(i)
    }
    o()
  }
  class Li {
    constructor({
      target: e,
      transform: i,
      map: n,
      style: s
    } = {}) {
      this.target = e, this.map = n, this.style = s, this.inverseTransform = l.Matrix4.inverseTransformation(i, new l.Matrix4), this.style && (this.group = n.addGraphic({
        type: "group",
        attr: {
          name: "\u5730\u5F62\u88C1\u526A"
        }
      }))
    }
    clip(e) {
      return this.clear(), e.length && this.booleanClockwise(e) && (e = e.reverse()), this.addClippingPlanes(e), this.style && Promise.all(e.map(i => new R(i).clampToTerrain(this.map, {
        async: !0
      }))).then(i => {
        this.addWallAndPolygon(i)
      }), this
    }
    addWallAndPolygon(e) {
      const {
        image: i = l.buildModuleUrl("../img/material/poly-soil.jpg"),
        imageBottom: n = l.buildModuleUrl("../img/material/poly-soil.jpg"),
        height: s = 20
      } = this.style, o = ft(e);
      this.group.addGraphic({
        type: "wall",
        positions: e,
        style: {
          diffHeight: -s,
          closure: !0,
          material: {
            type: "Image",
            image: i,
            transparent: !1,
            repeat: [o / s / 2, 1]
          }
        }
      }), this.group.addGraphic({
        type: "polygon",
        positions: e.map(a => a.clone().addHeight(-s)),
        style: {
          material: {
            type: "Image",
            image: n,
            transparent: !1
          }
        }
      })
    }
    addClippingPlanes(e) {
      let i = this.inverseTransform,
        n = e.length,
        s, o, a, c = [];
      for (let h = 0; h < n; ++h) {
        let u = (h + 1) % n;
        s = e[h], o = e[u], Hr(s, o) || (a = this.createPlane(s, o, i), c.push(a))
      }
      this.target.clippingPlanes = new l.ClippingPlaneCollection({
        planes: c,
        edgeWidth: 0,
        edgeColor: l.Color.WHITE
      })
    }
    getOriginCoordinateSystemPoint(e, i) {
      return l.Matrix4.multiplyByPoint(i, e, new l.Cartesian3(0, 0, 0))
    }
    createPlane(e, i, n) {
      let s = this.getOriginCoordinateSystemPoint(e, n),
        o = this.getOriginCoordinateSystemPoint(i, n),
        a = new l.Cartesian3(0, 0, 10),
        c = l.Cartesian3.subtract(o, s, new l.Cartesian3),
        h = l.Cartesian3.cross(c, a, new l.Cartesian3);
      h = l.Cartesian3.normalize(h, h);
      let u = l.Plane.fromPointNormal(s, h);
      return l.ClippingPlane.fromPlane(u)
    }
    booleanClockwise(e) {
      const i = l.Cartesian3.subtract(e[0], e[1], new l.Cartesian3),
        n = l.Cartesian3.subtract(e[0], e[2], new l.Cartesian3);
      return i.z = 0, n.z = 0, l.Cartesian3.cross(i, n, new l.Cartesian3).z < 0
    }
    cartesian3ToDegrees(e) {
      let i = l.Cartographic.fromCartesian(e);
      return [l.Math.toDegrees(i.longitude), l.Math.toDegrees(i.latitude)]
    }
    clear() {
      var e;
      !this.target || (this.target.clippingPlanes && (this.target.clippingPlanes.removeAll(), this.target.clippingPlanes = null), (e = this.group) == null || e.removeAllGraphic())
    }
    destroy() {
      this.target && (this.clear(), this.target = null), this.group && (this.group.destroy(), this.group = null)
    }
  }
  var Jp = `
            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
            {
              vec4 position = czm_inverseModelView * vec4(fsInput.attributes.positionEC,1); // \u4F4D\u7F6E

              // \u6CE8\u610Fshader\u4E2D\u5199\u6D6E\u70B9\u6570\u662F\uFF0C\u4E00\u5B9A\u8981\u5E26\u5C0F\u6570\u70B9\uFF0C\u5426\u5219\u4F1A\u62A5\u9519\uFF0C\u6BD4\u59820\u9700\u8981\u5199\u62100.0\uFF0C1\u8981\u5199\u62101.0
              float _baseHeight = 0.0; // \u7269\u4F53\u7684\u57FA\u7840\u9AD8\u5EA6\uFF0C\u9700\u8981\u4FEE\u6539\u6210\u4E00\u4E2A\u5408\u9002\u7684\u5EFA\u7B51\u57FA\u7840\u9AD8\u5EA6
              float _heightRange = 60.0; // \u9AD8\u4EAE\u7684\u8303\u56F4(_baseHeight ~ _baseHeight + _heightRange)
              float _glowRange = 100.0; // \u5149\u73AF\u7684\u79FB\u52A8\u8303\u56F4(\u9AD8\u5EA6)

              // \u5EFA\u7B51\u57FA\u7840\u8272
              float mars_height = position.z - _baseHeight;
              float mars_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;
              float mars_a12 = mars_height / _heightRange + sin(mars_a11) * 0.1;
              material.diffuse = vec3(1.0, 1.0, 1.0); // \u989C\u8272
              material.diffuse *= vec3(mars_a12);// \u6E10\u53D8

              // \u52A8\u6001\u5149\u73AF
              float time = fract(czm_frameNumber / 360.0);

              time = abs(time - 0.5) * 2.0;
              float mars_h = clamp(mars_height / _glowRange, 0.0, 1.0);
              float mars_diff = step(0.005, abs(mars_h - time));
              material.diffuse += material.diffuse * (1.0 - mars_diff);
            } `,
    $p = `
            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
            {
              vec3 finalColor = material.diffuse;
              vec3 rgba = material.diffuse;
              
              //\u8C03\u6574\u4EAE\u5EA6
              finalColor = finalColor * brightness;
             
              //\u8C03\u6574\u9971\u548C\u5EA6
              float luminance = 0.2125 * rgba.r + 0.7154 * rgba.g + 0.0721 * rgba.b;
              vec3 saturationTarget = vec3(luminance, luminance, luminance);
              finalColor = mix(saturationTarget, finalColor, saturation);
              
              //\u8C03\u6574\u5BF9\u6BD4\u5EA6
              vec3 contrastTarget = vec3(0.5,0.5,0.5);
              finalColor = mix(contrastTarget, finalColor, contrast);
              material.diffuse = finalColor;
            } `;
  class Gi extends st {
    constructor(e) {
      super(e);
      P(this, "type", G.Tileset);
      P(this, "resourceStyleFields", ["url", "uri"]);
      P(this, "sceneTreePromise", js());
      P(this, "_color", {
        conditions: []
      });
      P(this, "_height", 0);
      P(this, "_positionEdit", null);
      this.style.url || console.warn("tileset url is required\uFF01");
      const i = j({}, Ae(this.style, this.type));
      this.loadPromise = js(), l.Cesium3DTileset.fromUrl ? (this.primitive = {
        readyPromise: this.loadPromise
      }, l.Cesium3DTileset.fromUrl(i.url, i).then(n => {
        this.primitive = n, this.primitive.readyPromise = Promise.resolve(n), this.loadPromise.resolve(n)
      })) : (this.primitive = new l.Cesium3DTileset(se(j({}, i), {
        url: i.url || "blank"
      })), this.loadPromise.resolve(this.primitive)), this._getSceneTree(), this.loadPromise.then(() => {
        this.primitive.readyPromise.then(() => {
          this.fire("ready"), (e.position || e.rotate) && this.moveTo(e.position, e.rotate), e.clip && this.clip(e.clip.points || e.clip.positions, e.clip)
        }), ["allTilesLoaded", "initialTilesLoaded", "tileFailed", "tileLoad", "tileUnload"].forEach(n => {
          this.primitive[n].addEventListener((...s) => {
            this.fire(n, ...s)
          })
        })
      })
    }
    setOptions(e) {
      super.setOptions(e), e.clip && (this.options.clip = e.clip, this.clip(e.clip.points || e.clip.positions, e.clip))
    }
    _getTileProperty(e) {
      if (!(e.content && e.content.featuresLength)) return;
      const i = e.content.featuresLength,
        n = [];
      for (let s = 0; s < i; s++) {
        const o = e.content.getFeature(s),
          a = o.getPropertyNames();
        n.push(a.reduce((c, h) => se(j({}, c), {
          [h]: o.getProperty(h),
          feature: o
        }), {}))
      }
      return n
    }
    getAllPropertyWithTile() {
      return this.primitive._root.children.map(e => {
        const i = this._getTileProperty(e);
        return {
          tile: e,
          property: i
        }
      }).filter(e => e && e.property && e.property.length > 0)
    }
    getAllProperty() {
      return this.primitive._root.children.map(this._getTileProperty).filter(e => e && e.length > 0)
    }
    async _getSceneTree() {
      try {
        const e = l.Resource.createIfNeeded(this.style.url).clone();
        e.url = e._url.replace(/tileset.json/g, "scenetree.json");
        const i = await e.fetchJson();
        this.sceneTree = i.scenes, this.sceneTreePromise.resolve()
      } catch {
        this.sceneTree = [], this.sceneTreePromise.resolve()
      }
    }
    findElementByName(e, i = this.sceneTree) {
      for (const n of i) {
        if (n.name === e) return n;
        if (n.children) {
          const s = this.findElementByName(e, n.children);
          if (s) return s
        }
      }
    }
    locateScene(e, i = {}) {
      var a;
      if (Re(e) && (e = this.findElementByName(e)), !e) return;
      const n = e.sphere,
        s = this.primitive;
      if (!n || n[3] <= 0) return;
      let o = new l.Cartesian3(n[0], n[1], n[2]);
      try {
        let c = s._root.transform;
        c = l.Matrix4.inverse(c, new l.Matrix4);
        let h = s.root.computedTransform,
          u = l.Matrix4.multiply(h, c, new l.Matrix4);
        o = l.Matrix4.multiplyByPoint(u, o, new l.Cartesian3), this._map.viewer.camera.flyToBoundingSphere(new l.BoundingSphere(o, (a = i.range) != null ? a : n[3] + i.offsetRange || 0), j({
          duration: .5
        }, i)), i.lookAt && this._map.viewer.camera.lookAt(o)
      } catch {}
    }
    _addedHook() {
      this.loadPromise.then(() => {
        super._addedHook(), this.setStyle(this.style)
      })
    }
    flyTo(e) {
      return this.primitive.readyPromise.then(() => {
        super.flyTo(e)
      }), this
    }
    get boundingSphere() {
      try {
        return this.primitive.boundingSphere
      } catch {
        return null
      }
    }
    get readyPromise() {
      return Promise.all([this.primitive.readyPromise, this.sceneTreePromise])
    }
    get point() {
      return new R(Zp(this.primitive))
    }
    get center() {
      return this.point
    }
    get position() {
      return this.point
    }
    set position(e) {
      this.moveTo(e)
    }
    get hpr() {
      var s;
      if (l.Matrix4.IDENTITY.equals((s = this.primitive.root) == null ? void 0 : s.transform)) {
        const o = l.Transforms.eastNorthUpToFixedFrame(this.primitive.boundingSphere.center),
          {
            heading: a,
            roll: c,
            pitch: h
          } = l.Transforms.fixedFrameToHeadingPitchRoll(l.Matrix4.multiply(this.primitive.modelMatrix, o, new l.Matrix4));
        return {
          heading: +l.Math.toDegrees(a).toFixed(4),
          roll: +l.Math.toDegrees(c).toFixed(4),
          pitch: +l.Math.toDegrees(h).toFixed(4)
        }
      }
      const {
        heading: e,
        roll: i,
        pitch: n
      } = l.Transforms.fixedFrameToHeadingPitchRoll(this.primitive.root.computedTransform);
      return {
        heading: +l.Math.toDegrees(e).toFixed(4),
        roll: +l.Math.toDegrees(i).toFixed(4),
        pitch: +l.Math.toDegrees(n).toFixed(4)
      }
    }
    set hpr(e) {
      this.rotate(e)
    }
    rotate(e) {
      this.moveTo(null, e)
    }
    async moveTo(e, i = {}) {
      var h, u, d, p, f, m;
      await this.readyPromise;
      const n = new R(e || this.point);
      if (n.isZero()) return;
      const s = this.hpr,
        o = (u = (h = i.heading) != null ? h : i.rotateZ) != null ? u : s.heading,
        a = (p = (d = i.pitch) != null ? d : i.rotateY) != null ? p : s.pitch,
        c = (m = (f = i.roll) != null ? f : i.rotateX) != null ? m : s.roll;
      if (!n.isZero()) {
        this._position = e;
        const {
          modelMatrix: g,
          transform: y
        } = yh(n, {
          heading: o,
          pitch: a,
          roll: c
        }, this.primitive);
        U(g) && this.setStyle({
          modelMatrix: g
        }), U(y) && (this.primitive.root.transform = y), requestAnimationFrame(() => {
          e && this.fire("update:position", this.point), i && this.fire("update:hpr", this.hpr)
        })
      }
      return this
    }
    setColorStyle(e = this._color, i) {
      U(e) && (this._color = Fr(e)), Re(e) && (e = {
        conditions: [
          ["true", e]
        ]
      }), Ie(i) && (e.conditions = [...i, ...e.conditions]);
      const n = this.primitive.style || new l.Cesium3DTileStyle;
      return n.color = e, this.primitive.style = null, this.primitive.style = n, this
    }
    setShowStyle(e) {
      const i = this.primitive.style || new l.Cesium3DTileStyle;
      return i.show = e, this.primitive.style = null, this.primitive.style = i, this
    }
    async setStyle(e = {}) {
      var d;
      if (!this.primitive) return;
      this.options.style = zt(this.style, e), this.fire("update:style", this.style);
      const u = Ae(this.options.style, this.type),
        {
          modelMatrix: i,
          color: n,
          opacity: s,
          height: o,
          leJzwStyle: a,
          visualImpact: c
        } = u,
        h = re(u, ["modelMatrix", "color", "opacity", "height", "leJzwStyle", "visualImpact"]);
      if (U(i) && (this.primitive.modelMatrix = i), Xt([n, s]) && this.setColorStyle(`color('${n.toCssColorString()}')`), U(e.customShader) && (this.primitive.enableModelExperimental = !0, l.ExperimentalFeatures && (l.ExperimentalFeatures.enableModelExperimental = !0)), U(e.visualImpact))
        if (this.primitive.enableModelExperimental = !0, l.ExperimentalFeatures && (l.ExperimentalFeatures.enableModelExperimental = !0), ge(c)) {
          const {
            brightness: p = 1,
            saturation: f = 1,
            contrast: m = 1,
            light: g
          } = c;
          if ((d = this.primitive.customShader) == null ? void 0 : d.isVisualImpact) this.primitive.customShader.setUniform("brightness", p), this.primitive.customShader.setUniform("saturation", f), this.primitive.customShader.setUniform("contrast", m);
          else {
            const y = {
              fragmentShaderText: $p,
              uniforms: {
                brightness: {
                  type: l.UniformType.FLOAT,
                  value: p
                },
                saturation: {
                  type: l.UniformType.FLOAT,
                  value: f
                },
                contrast: {
                  type: l.UniformType.FLOAT,
                  value: m
                }
              }
            };
            U(g) && (y.lightingModel = g ? l.LightingModel.PBR : l.LightingModel.UNLIT), this.primitive.customShader = new l.CustomShader(y)
          }
          this.primitive.customShader.isVisualImpact = !0
        } else this.primitive.customShader = void 0;
      if (U(e.leJzwStyle) && (l.ExperimentalFeatures && (l.ExperimentalFeatures.enableModelExperimental = !0), this.primitive.enableModelExperimental = !0, a ? this.primitive.customShader = new l.CustomShader({
          lightingModel: l.LightingModel.UNLIT,
          fragmentShaderText: Re(a) ? a : Jp
        }) : this.primitive.customShader = void 0), Object.entries(h).forEach(([p, f]) => {
          this.primitive[p] = f
        }), U(e.clampToGround)) {
        if (e.clampToGround) {
          this.clampToGround();
          return
        }
        this.setHeight(this.style.height || 0);
        return
      }
      U(o) && this.setHeight(o)
    }
    clampToGround() {
      this.primitive.readyPromise.then(() => {
        this.point.clampToTerrain(this._map, {
          async: !0
        }).then(i => {
          i.addHeight(-1e3);
          const n = this.distanceSquaredTo(i) - this._height,
            s = 1e3 - n;
          console.log(`\u8C03\u6574\u9AD8\u5EA6\u4E3A${s}`), this.setHeight(s)
        })
      })
    }
    get height() {
      return this.point.height
    }
    setHeight(e) {
      ce(e) || (this._height = e, this.readyPromise.then(() => {
        const i = this.primitive,
          n = i.boundingSphere,
          s = l.Cartographic.fromCartesian(n.center),
          o = l.Cartesian3.fromRadians(s.longitude, s.latitude, 0),
          a = l.Cartesian3.fromRadians(s.longitude, s.latitude, e),
          c = l.Cartesian3.subtract(a, o, new l.Cartesian3),
          h = this.style.modelMatrix ? l.Matrix4.fromArray(this.style.modelMatrix) : l.Matrix4.IDENTITY;
        i.modelMatrix = l.Matrix4.multiply(h, l.Matrix4.fromTranslation(c), new l.Matrix4), requestAnimationFrame(() => {
          this.fire("update:position", this.point)
        })
      }))
    }
    distanceSquaredTo(e) {
      if (!e) return;
      const i = new R(e);
      return Math.sqrt(this.primitive._root.boundingVolume.boundingVolume.distanceSquaredTo(i))
    }
    clip(e, {
      terrain: i = !1,
      style: n
    } = {}) {
      this.tilesetClip && (this.tilesetClip.destroy(), this.tilesetClip = null), this.globeClip && (this.globeClip.destroy(), this.globeClip = null), !!(e && e.length) && (this.tilesetClip = new Li({
        target: this.primitive,
        transform: l.Transforms.eastNorthUpToFixedFrame(this.point),
        map: this._map
      }).clip(e.reverse().map(s => new R(s))), i && Promise.all(e.reverse().map(s => new R(s).clampToTerrain(this._map, {
        async: !0
      }))).then(s => {
        this.globeClip = new Li({
          target: this._map.globe,
          transform: l.Matrix4.IDENTITY,
          map: this._map
        }).clip(s, n)
      }), this.once("destroy", () => {
        this.tilesetClip && (this.tilesetClip.destroy(), this.tilesetClip = null), this.globeClip && (this.globeClip.destroy(), this.globeClip = null)
      }))
    }
    get boundingPoints() {
      return vh(this.primitive.root.boundingVolume.boundingVolume).map(e => new R(e))
    }
    get isPositionEditing() {
      return !!this._positionEdit
    }
    startPositionEdit(e) {
      !this._map || (this._positionEdit = new Lr({
        map: this._map,
        graphic: this,
        log: e
      }))
    }
    stopPositionEdit() {
      this._positionEdit && (this._positionEdit.destroy(), this._positionEdit = null)
    }
  }

  function Zp(r) {
    var s;
    let e = {};
    const i = (s = r.root) == null ? void 0 : s.transform;
    if (i && !i.equals(l.Matrix4.IDENTITY)) {
      let o = r.root.computedTransform,
        a = l.Matrix4.getTranslation(o, new l.Cartesian3),
        c = l.Cartographic.fromCartesian(a);
      l.defined(c) && (e.lng = Number(l.Math.toDegrees(c.longitude).toFixed(6)), e.lat = Number(l.Math.toDegrees(c.latitude).toFixed(6)), e.alt = Number(c.height.toFixed(2)))
    } else {
      let a = r.boundingSphere.center,
        c = l.Cartographic.fromCartesian(a),
        h = Number(c.height.toFixed(2)),
        u = Number(l.Math.toDegrees(c.longitude).toFixed(6)),
        d = Number(l.Math.toDegrees(c.latitude).toFixed(6));
      e = {
        lng: u,
        lat: d,
        alt: h
      }
    }
    return e
  }
  class oo extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Path);
      this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }
  class Ot extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Label);
      e.primitive ? this.primitive = {
        show: this.visible
      } : this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
    get text() {
      return this.style.text
    }
    set text(e) {
      this.setStyle({
        text: e
      })
    }
  }
  class Yr extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Point);
      e.primitive ? this.primitive = {
        show: this.visible
      } : this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e, i = this.type) {
      super.setStyle(e, i)
    }
  }
  class Rt extends st {
    constructor(e) {
      super(e);
      P(this, "isPointsGraphic", !0);
      const {
        positions: i = []
      } = e;
      this._positions = i
    }
    get positions() {
      return this._positions
    }
    set positions(e) {
      var i;
      if (e instanceof Function) {
        let n = e;
        e = new l.CallbackProperty(() => n(), !1)
      }
      this.options.positions = e, (i = this._updatePosition) == null || i.call(this), this.fire("update:positions", this.hpr)
    }
    get points() {
      var i, n;
      const e = this.positions;
      return e.getValue ? this._map ? (n = (i = this._positions.getValue(this._map.viewer.clock.currentTime)) == null ? void 0 : i.map(s => new R(s))) != null ? n : [] : [] : e.map(s => new R(s))
    }
    get boundingSphere() {
      return l.BoundingSphere.fromPoints(this.points)
    }
    get center() {
      return this.points.length ? new R(yr(this.points)) : null
    }
    _addedHook() {
      super._addedHook(), this.setStyle(this.style);
      const {
        clampToGround: e,
        addHeight: i,
        setHeight: n
      } = this.style;
      Vs([e, i, n]) && this._updatePosition()
    }
    setStyle(e, i) {
      super.setStyle(e, i);
      const {
        clampToGround: n,
        addHeight: s,
        setHeight: o,
        height: a
      } = e;
      Xt([n, s, o, a]) && this._updatePosition()
    }
    _updatePosition() {
      const e = this.options.positions;
      if (!e) {
        this._positions = e;
        return
      }
      if (e.getValue) {
        this._positions = e, this.entity && this.style.label && (this.entity.position = new l.CallbackProperty(() => this.center, !1));
        return
      }
      const {
        setHeight: i,
        addHeight: n
      } = this.style;
      e.length ? this._positions = e.map(s => new R(s, {
        setHeight: i,
        addHeight: n
      })) : this._positions = e, this.entity && this.style.label && (this.style.clampToGround ? this.center.clampToGround(this._map, {
        async: !0
      }).then(s => {
        this.entity.position = s
      }) : this.entity.position = this.center)
    }
    toGeoJson() {
      const e = this.points;
      if (e && e.length) return Fh(this.points.map(i => i.toLatLngArray()), {
        attr: this.attr,
        style: this.style,
        type: this.type
      })
    }
  }
  class Se extends Rt {
    constructor(e) {
      if (Oe(e.positions)) {
        const i = e.positions;
        e.positions = e.primitive ? i() : new l.CallbackProperty(() => {
          var n;
          return (n = i()) == null ? void 0 : n.map(s => new R(s))
        }, !1)
      }
      super(e);
      P(this, "type", G.Polyline);
      e.primitive ? this.primitive = {
        show: this.visible
      } : this.entity = new l.Entity({
        polyline: {},
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
    _updatePosition() {
      super._updatePosition();
      const e = this.positions;
      this.entity && (this.entity.polyline.positions = e), this.primitive && (this.primitive.positions = e)
    }
    computedLength() {
      return ft(this.points)
    }
  }
  const ef = {
    style: {
      point: {
        show: !0,
        pixelSize: 10,
        color: "#3388ff",
        opacity: 1,
        outline: !0,
        outlineColor: "#ffffff",
        outlineOpacity: .6,
        outlineWidth: 2
      },
      polyline: {
        show: !0,
        lineType: "solid",
        color: "#3388ff",
        width: 2
      },
      polygon: {
        show: !0,
        lineType: "solid",
        color: "#3388ff",
        width: 2,
        opacity: 1
      }
    }
  };
  class ao extends st {
    constructor(e = {}) {
      super(zt(ef, e));
      P(this, "type", G.GeoJson);
      this.dataSource = new l.GeoJsonDataSource, this.setOptions(e)
    }
    setOptions(e) {
      (e.url || e.data) && (e.url && this.setUrl(e.url), e.data && (this.readyPromise = this.dataSource.load(e.data), this.options.data = e.data), e.style || this.setStyle()), super.setOptions(e)
    }
    setUrl(e) {
      this.readyPromise = this.dataSource.load(e), this.options.url = e
    }
    async setStyle(e = {}) {
      !this.dataSource || (e.url && this.setUrl(e.url), await this.readyPromise, this.readyPromise.then(i => {
        this.options.style = zt(this.style, e);
        const n = Ae(this.options.style, this.type),
          s = [G.Polyline, G.Polygon, G.Point].reduce((o, a) => (n[a] && (o[a] = Ae(n[a], a)), o), {});
        i.entities.values.forEach(o => {
          var a;
          if (o.billboard && (o.billboard = void 0, o.point = {}), this.options.polygonToPolyline && o.polygon) {
            const c = o.polygon.hierarchy.getValue().positions;
            o.polyline = {
              positions: c.concat((a = c[0]) != null ? a : [])
            }
          }
          Object.entries(s).forEach(([c, h]) => {
            o[c] && Object.keys(h).forEach(u => {
              o[c][u] = h[u]
            })
          })
        })
      }))
    }
    async toJSON() {
      const e = await super.toJSON();
      return this.options.url && (e.url = this.options.url), this.options.data && (e.data = this.options.data), e
    }
    toData() {
      return this.options.url || this.options.data || ""
    }
    get boundingSphere() {
      return this._map ? this._map.getBoundingSphere(this.dataSource.entities.values) : new l.BoundingSphere
    }
  }
  class Xr extends Rt {
    constructor(e = {}) {
      if (Oe(e.positions)) {
        const i = e.positions;
        e.positions = e.primitive ? i() : new l.CallbackProperty(() => {
          var n;
          return new l.PolygonHierarchy((n = i()) == null ? void 0 : n.map(s => new R(s)))
        }, !1)
      }
      super(e);
      P(this, "type", G.Polygon);
      this.entity = new l.Entity({
        polygon: {},
        polyline: {
          arcType: l.ArcType.GEODESIC
        },
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type), this._updateHelperLineStyle(), this.graphicStyle.clampToGround ? this.entity.polyline.arcType = l.ArcType.GEODESIC : this.entity.polyline.arcType = this.graphicStyle.height !== void 0 ? l.ArcType.GEODESIC : l.ArcType.NONE
    }
    _updatePosition() {
      super._updatePosition();
      const e = this.positions;
      this.entity && (this.entity.polygon.show = !!(e && e.length || e && e.getValue), this.entity.polygon.hierarchy = e, this.entity.position = this.center, ce(this.graphicStyle.extrudedHeight) && (e && e.getValue ? this.entity.polyline.positions = new l.CallbackProperty(() => {
        const {
          positions: i
        } = e.getValue();
        return [...i, i[0]].filter(Boolean)
      }, !1) : this.entity.polyline.positions = e && [...e, e[0]].map(i => new R(i, {
        setHeight: this.style.height
      }))))
    }
    get points() {
      return this._positions ? this._positions.getValue ? this._map ? this._positions.getValue(this._map.viewer.clock.currentTime).positions.map(e => new R(e)) : [] : this._positions.map(e => new R(e, {
        addHeight: this.style.addHeight,
        setHeight: this.style.setHeight
      })) : []
    }
    toGeoJson() {
      return is(this.points.map(e => e.toLatLngArray()), {
        attr: this.attr,
        style: this.style,
        type: this.type
      })
    }
  }
  class lo extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Box);
      this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }
  class co extends Rt {
    constructor(e) {
      super(e);
      P(this, "type", G.Corridor);
      this.entity = new l.Entity({
        corridor: {},
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
    _updatePosition() {
      super._updatePosition();
      const e = this.positions;
      this.entity && (this.entity.corridor.positions = e)
    }
  }
  class ho extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Cylinder);
      this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }
  class uo extends Rt {
    constructor(e) {
      super(e);
      P(this, "type", G.PolylineVolume);
      this.entity = new l.Entity({
        polylineVolume: {},
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
    _updatePosition() {
      super._updatePosition();
      const e = this.positions;
      this.entity && (this.entity.polylineVolume.positions = e)
    }
  }
  class Fi extends Rt {
    constructor(e) {
      super(e);
      P(this, "type", G.Rectangle);
      this.entity = new l.Entity({
        rectangle: {},
        polyline: {
          arcType: l.ArcType.RHUMB
        },
        show: this.visible
      })
    }
    set positions(e) {
      this._positions = e, this.options.positions = e, this._updatePosition && this._updatePosition()
    }
    get rectangle() {
      return this.entity.rectangle.coordinates.getValue(this._map.viewer.clock.currentTime)
    }
    get boundingPoints() {
      let e = this.rectangle;
      return e ? [l.Rectangle.southeast(e), l.Rectangle.northeast(e), l.Rectangle.northwest(e), l.Rectangle.southwest(e)].map(i => new R(i)) : []
    }
    get positions() {
      const e = this.rectangle;
      return e ? [l.Rectangle.northwest(e), l.Rectangle.southeast(e)].map(i => new R(i)) : []
    }
    setStyle(e) {
      super.setStyle(e, this.type), this._updateHelperLineStyle()
    }
    _updatePosition() {
      let e = this._positions;
      if (this.entity && (e instanceof Array && (e = l.Rectangle.fromCartesianArray(e.map(i => new R(i)))), this.entity.rectangle.coordinates = e, ce(this.graphicStyle.extrudedHeight)))
        if (e && e.getValue) {
          const i = this;
          this.entity.polyline.positions = new l.CallbackProperty(() => {
            const n = this.boundingPoints;
            return n.concat(n[0]).map(s => new R(s, {
              setHeight: i.style.height
            }))
          }, !1)
        } else {
          const i = this.boundingPoints;
          this.entity.polyline.positions = i.concat(i[0]).map(n => new R(n, {
            setHeight: this.style.height
          }))
        }
    }
    toGeoJson() {
      return is(this.boundingPoints.map(e => e.toLatLngArray()), {
        attr: this.attr,
        style: this.style,
        type: this.type
      })
    }
  }
  class Kr extends Rt {
    constructor(e) {
      super(e);
      P(this, "type", G.Wall);
      this.entity = new l.Entity({
        wall: {
          positions: this.positions
        },
        show: this.visible
      })
    }
    setStyle(e) {
      var i, n, s;
      if (U(e.diffHeight) || U(e.height)) {
        const o = (i = e.closure) != null ? i : this.style.closure,
          a = (n = e.height) != null ? n : this.style.height,
          c = (s = e.diffHeight) != null ? s : this.style.diffHeight;
        if (this.positions.getValue) e.minimumHeights = new l.CallbackProperty(() => {
          const h = this.points;
          return (o ? h.concat(h[0]) : h).filter(Boolean).map(u => a != null ? a : u.height)
        }, !1), e.maximumHeights = new l.CallbackProperty(() => {
          const h = this.points;
          return (o ? h.concat(h[0]) : h).filter(Boolean).map(u => (a != null ? a : u.height) + c)
        }, !1);
        else {
          const h = this.points;
          e.minimumHeights = (o ? h.concat(h[0]) : h).filter(Boolean).map(u => a != null ? a : u.height), e.maximumHeights = (o ? h.concat(h[0]) : h).filter(Boolean).map(u => (a != null ? a : u.height) + c)
        }
      }
      super.setStyle(e, this.type), e.closure && this._updatePosition()
    }
    _updatePosition() {
      super._updatePosition();
      const e = this.positions;
      this.entity && (this.graphicStyle.closure && e && !e.getValue ? this.entity.wall.positions = [...e, e[0]].filter(Boolean) : this.graphicStyle.closure ? this.entity.wall.positions = new l.CallbackProperty((...i) => {
        const n = e.getValue(...i);
        return n && [...n, n[0]].filter(Boolean)
      }, !1) : this.entity.wall.positions = e)
    }
  }
  class po extends Ne {
    constructor(e) {
      super(e);
      P(this, "type", G.Plane);
      this.entity = new l.Entity({
        show: this.visible
      })
    }
    setStyle(e) {
      super.setStyle(e, this.type)
    }
  }(function (r, e, i) {
    typeof module != "undefined" && module.exports ? module.exports = i() : typeof define == "function" && define.amd ? define(i) : e[r] = i()
  })("h337", window, () => {
    let r = {
        defaultRadius: 40,
        defaultRenderer: "canvas2d",
        defaultGradient: {
          .25: "rgb(0,0,255)",
          .55: "rgb(0,255,0)",
          .85: "yellow",
          1: "rgb(255,0,0)"
        },
        defaultMaxOpacity: 1,
        defaultMinOpacity: 0,
        defaultBlur: .85,
        defaultXField: "x",
        defaultYField: "y",
        defaultValueField: "value",
        plugins: {}
      },
      e = function () {
        let h = function (p) {
            this._coordinator = {}, this._data = [], this._radi = [], this._min = 10, this._max = 1, this._xField = p.xField || p.defaultXField, this._yField = p.yField || p.defaultYField, this._valueField = p.valueField || p.defaultValueField, p.radius && (this._cfgRadius = p.radius)
          },
          u = r.defaultRadius;
        return h.prototype = {
          _organiseData(d, p) {
            let f = d[this._xField],
              m = d[this._yField],
              g = this._radi,
              y = this._data,
              x = this._max,
              A = this._min,
              _ = d[this._valueField] || 1,
              v = d.radius || this._cfgRadius || u;
            y[f] || (y[f] = [], g[f] = []), y[f][m] ? y[f][m] += _ : (y[f][m] = _, g[f][m] = v);
            let b = y[f][m];
            return b > x ? (p ? this.setDataMax(b) : this._max = b, !1) : b < A ? (p ? this.setDataMin(b) : this._min = b, !1) : {
              x: f,
              y: m,
              value: _,
              radius: v,
              min: A,
              max: x
            }
          },
          _unOrganizeData() {
            let d = [],
              p = this._data,
              f = this._radi;
            for (let m in p)
              for (let g in p[m]) d.push({
                x: m,
                y: g,
                radius: f[m][g],
                value: p[m][g]
              });
            return {
              min: this._min,
              max: this._max,
              data: d
            }
          },
          _onExtremaChange() {
            this._coordinator.emit("extremachange", {
              min: this._min,
              max: this._max
            })
          },
          addData() {
            if (arguments[0].length > 0) {
              let d = arguments[0],
                p = d.length;
              for (; p--;) this.addData.call(this, d[p])
            } else {
              let d = this._organiseData(arguments[0], !0);
              d && (this._data.length === 0 && (this._min = this._max = d.value), this._coordinator.emit("renderpartial", {
                min: this._min,
                max: this._max,
                data: [d]
              }))
            }
            return this
          },
          setData(d) {
            let p = d.data,
              f = p.length;
            this._data = [], this._radi = [];
            for (let m = 0; m < f; m++) this._organiseData(p[m], !1);
            return this._max = d.max, this._min = d.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
          },
          removeData() {},
          setDataMax(d) {
            return this._max = d, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
          },
          setDataMin(d) {
            return this._min = d, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
          },
          setCoordinator(d) {
            this._coordinator = d
          },
          _getInternalData() {
            return {
              max: this._max,
              min: this._min,
              data: this._data,
              radi: this._radi
            }
          },
          getData() {
            return this._unOrganizeData()
          }
        }, h
      }(),
      i = function () {
        let h = function (f) {
            let m = f.gradient || f.defaultGradient,
              g = document.createElement("canvas"),
              y = g.getContext("2d");
            g.width = 256, g.height = 1;
            let x = y.createLinearGradient(0, 0, 256, 1);
            for (let A in m) x.addColorStop(A, m[A]);
            return y.fillStyle = x, y.fillRect(0, 0, 256, 1), y.getImageData(0, 0, 256, 1).data
          },
          u = function (f, m) {
            let g = document.createElement("canvas"),
              y = g.getContext("2d"),
              x = f,
              A = f;
            if (g.width = g.height = f * 2, m == 1) y.beginPath(), y.arc(x, A, f, 0, 2 * Math.PI, !1), y.fillStyle = "rgba(0,0,0,1)", y.fill();
            else {
              let _ = y.createRadialGradient(x, A, f * m, x, A, f);
              _.addColorStop(0, "rgba(0,0,0,1)"), _.addColorStop(1, "rgba(0,0,0,0)"), y.fillStyle = _, y.fillRect(0, 0, 2 * f, 2 * f)
            }
            return g
          },
          d = function (f) {
            let m = [],
              g = f.min,
              y = f.max,
              x = f.radi;
            var f = f.data;
            let A = Object.keys(f),
              _ = A.length;
            for (; _--;) {
              let v = A[_],
                b = Object.keys(f[v]),
                C = b.length;
              for (; C--;) {
                let M = b[C],
                  S = f[v][M],
                  H = x[v][M];
                m.push({
                  x: v,
                  y: M,
                  value: S,
                  radius: H
                })
              }
            }
            return {
              min: g,
              max: y,
              data: m
            }
          };

        function p(f) {
          let m = f.container,
            g = this.shadowCanvas = document.createElement("canvas"),
            y = this.canvas = f.canvas || document.createElement("canvas");
          this._renderBoundaries = [1e4, 1e4, 0, 0];
          let x = getComputedStyle(f.container) || {};
          y.className = "heatmap-canvas", this._width = y.width = g.width = f.width || +x.width.replace(/px/, ""), this._height = y.height = g.height = f.height || +x.height.replace(/px/, ""), this.shadowCtx = g.getContext("2d"), this.ctx = y.getContext("2d"), y.style.cssText = g.style.cssText = "position:absolute;left:0;top:0;", m.style.position = "relative", m.appendChild(y), this._palette = h(f), this._templates = {}, this._setStyles(f)
        }
        return p.prototype = {
          renderPartial(f) {
            f.data.length > 0 && (this._drawAlpha(f), this._colorize())
          },
          renderAll(f) {
            this._clear(), f.data.length > 0 && (this._drawAlpha(d(f)), this._colorize())
          },
          _updateGradient(f) {
            this._palette = h(f)
          },
          updateConfig(f) {
            f.gradient && this._updateGradient(f), this._setStyles(f)
          },
          setDimensions(f, m) {
            this._width = f, this._height = m, this.canvas.width = this.shadowCanvas.width = f, this.canvas.height = this.shadowCanvas.height = m
          },
          _clear() {
            this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height)
          },
          _setStyles(f) {
            this._blur = f.blur == 0 ? 0 : f.blur || f.defaultBlur, f.backgroundColor && (this.canvas.style.backgroundColor = f.backgroundColor), this._width = this.canvas.width = this.shadowCanvas.width = f.width || this._width, this._height = this.canvas.height = this.shadowCanvas.height = f.height || this._height, this._opacity = (f.opacity || 0) * 255, this._maxOpacity = (f.maxOpacity || f.defaultMaxOpacity) * 255, this._minOpacity = (f.minOpacity || f.defaultMinOpacity) * 255, this._useGradientOpacity = !!f.useGradientOpacity
          },
          _drawAlpha(f) {
            let m = this._min = f.min,
              g = this._max = f.max;
            var f = f.data || [];
            let y = f.length,
              x = 1 - this._blur;
            for (; y--;) {
              let _ = f[y],
                v = _.x,
                b = _.y,
                C = _.radius,
                M = Math.min(_.value, g),
                S = v - C,
                H = b - C,
                N = this.shadowCtx;
              var A;
              this._templates[C] ? A = this._templates[C] : this._templates[C] = A = u(C, x);
              let w = (M - m) / (g - m);
              N.globalAlpha = w < .01 ? .01 : w, N.drawImage(A, S, H), S < this._renderBoundaries[0] && (this._renderBoundaries[0] = S), H < this._renderBoundaries[1] && (this._renderBoundaries[1] = H), S + 2 * C > this._renderBoundaries[2] && (this._renderBoundaries[2] = S + 2 * C), H + 2 * C > this._renderBoundaries[3] && (this._renderBoundaries[3] = H + 2 * C)
            }
          },
          _colorize() {
            let f = this._renderBoundaries[0],
              m = this._renderBoundaries[1],
              g = this._renderBoundaries[2] - f,
              y = this._renderBoundaries[3] - m,
              x = this._width,
              A = this._height,
              _ = this._opacity,
              v = this._maxOpacity,
              b = this._minOpacity,
              C = this._useGradientOpacity;
            f < 0 && (f = 0), m < 0 && (m = 0), f + g > x && (g = x - f), m + y > A && (y = A - m);
            let M = this.shadowCtx.getImageData(f, m, g, y),
              S = M.data,
              H = S.length,
              N = this._palette;
            for (let E = 3; E < H; E += 4) {
              let B = S[E],
                T = B * 4;
              if (!!T) {
                var w;
                _ > 0 ? w = _ : B < v ? B < b ? w = b : w = B : w = v, S[E - 3] = N[T], S[E - 2] = N[T + 1], S[E - 1] = N[T + 2], S[E] = C ? N[T + 3] : w
              }
            }
            this.ctx.putImageData(M, f, m), this._renderBoundaries = [1e3, 1e3, 0, 0]
          },
          getValueAt(f) {
            let m, x = this.shadowCtx.getImageData(f.x, f.y, 1, 1).data[3],
              A = this._max,
              _ = this._min;
            return m = Math.abs(A - _) * (x / 255) >> 0, m
          },
          getDataURL() {
            return this.canvas.toDataURL()
          }
        }, p
      }(),
      n = function () {
        let h = !1;
        return r.defaultRenderer === "canvas2d" && (h = i), h
      }(),
      s = {
        merge() {
          let c = {},
            h = arguments.length;
          for (let u = 0; u < h; u++) {
            let d = arguments[u];
            for (let p in d) c[p] = d[p]
          }
          return c
        }
      },
      o = function () {
        let h = function () {
            function f() {
              this.cStore = {}
            }
            return f.prototype = {
              on(m, g, y) {
                let x = this.cStore;
                x[m] || (x[m] = []), x[m].push(A => g.call(y, A))
              },
              emit(m, g) {
                let y = this.cStore;
                if (y[m]) {
                  let x = y[m].length;
                  for (let A = 0; A < x; A++) y[m][A](g)
                }
              }
            }, f
          }(),
          u = function (p) {
            let f = p._renderer,
              m = p._coordinator,
              g = p._store;
            m.on("renderpartial", f.renderPartial, f), m.on("renderall", f.renderAll, f), m.on("extremachange", y => {
              p._config.onExtremaChange && p._config.onExtremaChange({
                min: y.min,
                max: y.max,
                gradient: p._config.gradient || p._config.defaultGradient
              })
            }), g.setCoordinator(m)
          };

        function d() {
          let p = this._config = s.merge(r, arguments[0] || {});
          if (this._coordinator = new h, p.plugin) {
            let f = p.plugin;
            if (r.plugins[f]) {
              let m = r.plugins[f];
              this._renderer = new m.renderer(p), this._store = new m.store(p)
            } else throw new Error(`Plugin '${f}' not found. Maybe it was not registered.`)
          } else this._renderer = new n(p), this._store = new e(p);
          u(this)
        }
        return d.prototype = {
          addData() {
            return this._store.addData.apply(this._store, arguments), this
          },
          removeData() {
            return this._store.removeData && this._store.removeData.apply(this._store, arguments), this
          },
          setData() {
            return this._store.setData.apply(this._store, arguments), this
          },
          setDataMax() {
            return this._store.setDataMax.apply(this._store, arguments), this
          },
          setDataMin() {
            return this._store.setDataMin.apply(this._store, arguments), this
          },
          configure(p) {
            return this._config = s.merge(this._config, p), this._renderer.updateConfig(this._config), this._coordinator.emit("renderall", this._store._getInternalData()), this
          },
          repaint() {
            return this._coordinator.emit("renderall", this._store._getInternalData()), this
          },
          getData() {
            return this._store.getData()
          },
          getDataURL() {
            return this._renderer.getDataURL()
          },
          getValueAt(p) {
            return this._store.getValueAt ? this._store.getValueAt(p) : this._renderer.getValueAt ? this._renderer.getValueAt(p) : null
          }
        }, d
      }();
    return {
      create(c) {
        return new o(c)
      },
      register(c, h) {
        r.plugins[c] = h
      }
    }
  });
  class fo extends Fi {
    constructor() {
      super(...arguments);
      P(this, "isFirst", !0)
    }
    _getMRect(e) {
      let i = this._WMP.project(l.Rectangle.southwest(e)),
        n = this._WMP.project(l.Rectangle.northeast(e));
      return {
        west: i.x,
        south: i.y,
        east: n.x,
        north: n.y
      }
    }
    _getRect(e) {
      var h;
      const i = l.Rectangle.fromCartesianArray(e.map(u => new R(u.position))),
        {
          x: n,
          y: s,
          width: o,
          height: a
        } = l.BoundingRectangle.fromRectangle(i, this._WMP),
        c = (h = this.style.radius) != null ? h : 40;
      return l.Rectangle.fromCartographicArray([this._WMP.unproject({
        x: n - c,
        y: s - c
      }), this._WMP.unproject({
        x: n + o + c,
        y: s - c
      }), this._WMP.unproject({
        x: n + o + c,
        y: s + a + c
      }), this._WMP.unproject({
        x: n - c,
        y: s + a + c
      })])
    }
    setPositions(e) {
      var a, c;
      if (!this._map) {
        console.warn("\u8BF7\u5148\u6DFB\u52A0\u5230 map\u4E2D");
        return
      }
      this._heat || (this._heat = this._createHeatMap());
      const i = this._getRect(e),
        n = this._getMRect(i),
        s = Math.min(this._width / Math.abs(n.west - n.east), this._height / Math.abs(n.north - n.south)),
        o = (a = this.style.radius) != null ? a : 40;
      this._heat.setData({
        max: (c = this.options.style.max) != null ? c : Math.max(...e.map(h => h.value)),
        data: e.map(h => {
          const {
            x: u,
            y: d
          } = this._WMP.project(new R(h.position).toCartographic());
          return {
            x: Math.round(Math.abs(u - n.west) * s),
            y: Math.round(Math.abs(d - n.north) * s),
            value: h.value,
            radius: o * s
          }
        })
      }), this.setStyle({
        clampToGround: !0,
        material: {
          type: "Image",
          image: new l.CallbackProperty(() => this._heat._renderer.canvas.toDataURL(), !1)
        }
      }), this.positions = l.Rectangle.fromCartographicArray([this._WMP.unproject({
        x: n.west,
        y: n.north
      }), this._WMP.unproject({
        x: n.west + this._width / s,
        y: n.north - this._height / s
      })])
    }
    _createHeatMap() {
      this._WMP = new l.WebMercatorProjection;
      const e = document.createElement("div");
      return this._width = this._map.viewer.canvas.width, this._height = this._map.viewer.canvas.height, e.setAttribute("style", `width:${this._width}px;height:${this._height}px;margin: 0px;display:none;`), document.body.appendChild(e), this.once("destroy", () => {
        document.body.removeChild(e)
      }), window.h337.create(j({
        container: e
      }, this.style))
    }
  }
  var Zt = {
      Linear: {
        None: function (r) {
          return r
        }
      },
      Quadratic: {
        In: function (r) {
          return r * r
        },
        Out: function (r) {
          return r * (2 - r)
        },
        InOut: function (r) {
          return (r *= 2) < 1 ? .5 * r * r : -.5 * (--r * (r - 2) - 1)
        }
      },
      Cubic: {
        In: function (r) {
          return r * r * r
        },
        Out: function (r) {
          return --r * r * r + 1
        },
        InOut: function (r) {
          return (r *= 2) < 1 ? .5 * r * r * r : .5 * ((r -= 2) * r * r + 2)
        }
      },
      Quartic: {
        In: function (r) {
          return r * r * r * r
        },
        Out: function (r) {
          return 1 - --r * r * r * r
        },
        InOut: function (r) {
          return (r *= 2) < 1 ? .5 * r * r * r * r : -.5 * ((r -= 2) * r * r * r - 2)
        }
      },
      Quintic: {
        In: function (r) {
          return r * r * r * r * r
        },
        Out: function (r) {
          return --r * r * r * r * r + 1
        },
        InOut: function (r) {
          return (r *= 2) < 1 ? .5 * r * r * r * r * r : .5 * ((r -= 2) * r * r * r * r + 2)
        }
      },
      Sinusoidal: {
        In: function (r) {
          return 1 - Math.cos(r * Math.PI / 2)
        },
        Out: function (r) {
          return Math.sin(r * Math.PI / 2)
        },
        InOut: function (r) {
          return .5 * (1 - Math.cos(Math.PI * r))
        }
      },
      Exponential: {
        In: function (r) {
          return r === 0 ? 0 : Math.pow(1024, r - 1)
        },
        Out: function (r) {
          return r === 1 ? 1 : 1 - Math.pow(2, -10 * r)
        },
        InOut: function (r) {
          return r === 0 ? 0 : r === 1 ? 1 : (r *= 2) < 1 ? .5 * Math.pow(1024, r - 1) : .5 * (-Math.pow(2, -10 * (r - 1)) + 2)
        }
      },
      Circular: {
        In: function (r) {
          return 1 - Math.sqrt(1 - r * r)
        },
        Out: function (r) {
          return Math.sqrt(1 - --r * r)
        },
        InOut: function (r) {
          return (r *= 2) < 1 ? -.5 * (Math.sqrt(1 - r * r) - 1) : .5 * (Math.sqrt(1 - (r -= 2) * r) + 1)
        }
      },
      Elastic: {
        In: function (r) {
          return r === 0 ? 0 : r === 1 ? 1 : -Math.pow(2, 10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI)
        },
        Out: function (r) {
          return r === 0 ? 0 : r === 1 ? 1 : Math.pow(2, -10 * r) * Math.sin((r - .1) * 5 * Math.PI) + 1
        },
        InOut: function (r) {
          return r === 0 ? 0 : r === 1 ? 1 : (r *= 2, r < 1 ? -.5 * Math.pow(2, 10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI) : .5 * Math.pow(2, -10 * (r - 1)) * Math.sin((r - 1.1) * 5 * Math.PI) + 1)
        }
      },
      Back: {
        In: function (r) {
          var e = 1.70158;
          return r * r * ((e + 1) * r - e)
        },
        Out: function (r) {
          var e = 1.70158;
          return --r * r * ((e + 1) * r + e) + 1
        },
        InOut: function (r) {
          var e = 1.70158 * 1.525;
          return (r *= 2) < 1 ? .5 * (r * r * ((e + 1) * r - e)) : .5 * ((r -= 2) * r * ((e + 1) * r + e) + 2)
        }
      },
      Bounce: {
        In: function (r) {
          return 1 - Zt.Bounce.Out(1 - r)
        },
        Out: function (r) {
          return r < 1 / 2.75 ? 7.5625 * r * r : r < 2 / 2.75 ? 7.5625 * (r -= 1.5 / 2.75) * r + .75 : r < 2.5 / 2.75 ? 7.5625 * (r -= 2.25 / 2.75) * r + .9375 : 7.5625 * (r -= 2.625 / 2.75) * r + .984375
        },
        InOut: function (r) {
          return r < .5 ? Zt.Bounce.In(r * 2) * .5 : Zt.Bounce.Out(r * 2 - 1) * .5 + .5
        }
      }
    },
    ei;
  typeof self == "undefined" && typeof process != "undefined" && process.hrtime ? ei = function () {
    var r = process.hrtime();
    return r[0] * 1e3 + r[1] / 1e6
  } : typeof self != "undefined" && self.performance !== void 0 && self.performance.now !== void 0 ? ei = self.performance.now.bind(self.performance) : Date.now !== void 0 ? ei = Date.now : ei = function () {
    return new Date().getTime()
  };
  var mt = ei,
    mo = function () {
      function r() {
        this._tweens = {}, this._tweensAddedDuringUpdate = {}
      }
      return r.prototype.getAll = function () {
        var e = this;
        return Object.keys(this._tweens).map(function (i) {
          return e._tweens[i]
        })
      }, r.prototype.removeAll = function () {
        this._tweens = {}
      }, r.prototype.add = function (e) {
        this._tweens[e.getId()] = e, this._tweensAddedDuringUpdate[e.getId()] = e
      }, r.prototype.remove = function (e) {
        delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()]
      }, r.prototype.update = function (e, i) {
        e === void 0 && (e = mt()), i === void 0 && (i = !1);
        var n = Object.keys(this._tweens);
        if (n.length === 0) return !1;
        for (; n.length > 0;) {
          this._tweensAddedDuringUpdate = {};
          for (var s = 0; s < n.length; s++) {
            var o = this._tweens[n[s]],
              a = !i;
            o && o.update(e, a) === !1 && !i && delete this._tweens[n[s]]
          }
          n = Object.keys(this._tweensAddedDuringUpdate)
        }
        return !0
      }, r
    }(),
    Bt = {
      Linear: function (r, e) {
        var i = r.length - 1,
          n = i * e,
          s = Math.floor(n),
          o = Bt.Utils.Linear;
        return e < 0 ? o(r[0], r[1], n) : e > 1 ? o(r[i], r[i - 1], i - n) : o(r[s], r[s + 1 > i ? i : s + 1], n - s)
      },
      Bezier: function (r, e) {
        for (var i = 0, n = r.length - 1, s = Math.pow, o = Bt.Utils.Bernstein, a = 0; a <= n; a++) i += s(1 - e, n - a) * s(e, a) * r[a] * o(n, a);
        return i
      },
      CatmullRom: function (r, e) {
        var i = r.length - 1,
          n = i * e,
          s = Math.floor(n),
          o = Bt.Utils.CatmullRom;
        return r[0] === r[i] ? (e < 0 && (s = Math.floor(n = i * (1 + e))), o(r[(s - 1 + i) % i], r[s], r[(s + 1) % i], r[(s + 2) % i], n - s)) : e < 0 ? r[0] - (o(r[0], r[0], r[1], r[1], -n) - r[0]) : e > 1 ? r[i] - (o(r[i], r[i], r[i - 1], r[i - 1], n - i) - r[i]) : o(r[s ? s - 1 : 0], r[s], r[i < s + 1 ? i : s + 1], r[i < s + 2 ? i : s + 2], n - s)
      },
      Utils: {
        Linear: function (r, e, i) {
          return (e - r) * i + r
        },
        Bernstein: function (r, e) {
          var i = Bt.Utils.Factorial;
          return i(r) / i(e) / i(r - e)
        },
        Factorial: function () {
          var r = [1];
          return function (e) {
            var i = 1;
            if (r[e]) return r[e];
            for (var n = e; n > 1; n--) i *= n;
            return r[e] = i, i
          }
        }(),
        CatmullRom: function (r, e, i, n, s) {
          var o = (i - r) * .5,
            a = (n - e) * .5,
            c = s * s,
            h = s * c;
          return (2 * e - 2 * i + o + a) * h + (-3 * e + 3 * i - 2 * o - a) * c + o * s + e
        }
      }
    },
    Jr = function () {
      function r() {}
      return r.nextId = function () {
        return r._nextId++
      }, r._nextId = 0, r
    }(),
    go = new mo,
    tf = function () {
      function r(e, i) {
        i === void 0 && (i = go), this._object = e, this._group = i, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Zt.Linear.None, this._interpolationFunction = Bt.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = Jr.nextId(), this._isChainStopped = !1, this._goToEnd = !1
      }
      return r.prototype.getId = function () {
        return this._id
      }, r.prototype.isPlaying = function () {
        return this._isPlaying
      }, r.prototype.isPaused = function () {
        return this._isPaused
      }, r.prototype.to = function (e, i) {
        return this._valuesEnd = Object.create(e), i !== void 0 && (this._duration = i), this
      }, r.prototype.duration = function (e) {
        return this._duration = e, this
      }, r.prototype.start = function (e) {
        if (this._isPlaying) return this;
        if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) {
          this._reversed = !1;
          for (var i in this._valuesStartRepeat) this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i]
        }
        return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e !== void 0 ? typeof e == "string" ? mt() + parseFloat(e) : e : mt(), this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this
      }, r.prototype._setupProperties = function (e, i, n, s) {
        for (var o in n) {
          var a = e[o],
            c = Array.isArray(a),
            h = c ? "array" : typeof a,
            u = !c && Array.isArray(n[o]);
          if (!(h === "undefined" || h === "function")) {
            if (u) {
              var d = n[o];
              if (d.length === 0) continue;
              d = d.map(this._handleRelativeValue.bind(this, a)), n[o] = [a].concat(d)
            }
            if ((h === "object" || c) && a && !u) {
              i[o] = c ? [] : {};
              for (var p in a) i[o][p] = a[p];
              s[o] = c ? [] : {}, this._setupProperties(a, i[o], n[o], s[o])
            } else typeof i[o] == "undefined" && (i[o] = a), c || (i[o] *= 1), u ? s[o] = n[o].slice().reverse() : s[o] = i[o] || 0
          }
        }
      }, r.prototype.stop = function () {
        return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this
      }, r.prototype.end = function () {
        return this._goToEnd = !0, this.update(1 / 0), this
      }, r.prototype.pause = function (e) {
        return e === void 0 && (e = mt()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this)
      }, r.prototype.resume = function (e) {
        return e === void 0 && (e = mt()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this)
      }, r.prototype.stopChainedTweens = function () {
        for (var e = 0, i = this._chainedTweens.length; e < i; e++) this._chainedTweens[e].stop();
        return this
      }, r.prototype.group = function (e) {
        return this._group = e, this
      }, r.prototype.delay = function (e) {
        return this._delayTime = e, this
      }, r.prototype.repeat = function (e) {
        return this._initialRepeat = e, this._repeat = e, this
      }, r.prototype.repeatDelay = function (e) {
        return this._repeatDelayTime = e, this
      }, r.prototype.yoyo = function (e) {
        return this._yoyo = e, this
      }, r.prototype.easing = function (e) {
        return this._easingFunction = e, this
      }, r.prototype.interpolation = function (e) {
        return this._interpolationFunction = e, this
      }, r.prototype.chain = function () {
        for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i];
        return this._chainedTweens = e, this
      }, r.prototype.onStart = function (e) {
        return this._onStartCallback = e, this
      }, r.prototype.onUpdate = function (e) {
        return this._onUpdateCallback = e, this
      }, r.prototype.onRepeat = function (e) {
        return this._onRepeatCallback = e, this
      }, r.prototype.onComplete = function (e) {
        return this._onCompleteCallback = e, this
      }, r.prototype.onStop = function (e) {
        return this._onStopCallback = e, this
      }, r.prototype.update = function (e, i) {
        if (e === void 0 && (e = mt()), i === void 0 && (i = !0), this._isPaused) return !0;
        var n, s, o = this._startTime + this._duration;
        if (!this._goToEnd && !this._isPlaying) {
          if (e > o) return !1;
          i && this.start(e)
        }
        if (this._goToEnd = !1, e < this._startTime) return !0;
        this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), s = (e - this._startTime) / this._duration, s = this._duration === 0 || s > 1 ? 1 : s;
        var a = this._easingFunction(s);
        if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, a), this._onUpdateCallback && this._onUpdateCallback(this._object, s), s === 1)
          if (this._repeat > 0) {
            isFinite(this._repeat) && this._repeat--;
            for (n in this._valuesStartRepeat) !this._yoyo && typeof this._valuesEnd[n] == "string" && (this._valuesStartRepeat[n] = this._valuesStartRepeat[n] + parseFloat(this._valuesEnd[n])), this._yoyo && this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
            return this._yoyo && (this._reversed = !this._reversed), this._repeatDelayTime !== void 0 ? this._startTime = e + this._repeatDelayTime : this._startTime = e + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), !0
          } else {
            this._onCompleteCallback && this._onCompleteCallback(this._object);
            for (var c = 0, h = this._chainedTweens.length; c < h; c++) this._chainedTweens[c].start(this._startTime + this._duration);
            return this._isPlaying = !1, !1
          } return !0
      }, r.prototype._updateProperties = function (e, i, n, s) {
        for (var o in n)
          if (i[o] !== void 0) {
            var a = i[o] || 0,
              c = n[o],
              h = Array.isArray(e[o]),
              u = Array.isArray(c),
              d = !h && u;
            d ? e[o] = this._interpolationFunction(c, s) : typeof c == "object" && c ? this._updateProperties(e[o], a, c, s) : (c = this._handleRelativeValue(a, c), typeof c == "number" && (e[o] = a + (c - a) * s))
          }
      }, r.prototype._handleRelativeValue = function (e, i) {
        return typeof i != "string" ? i : i.charAt(0) === "+" || i.charAt(0) === "-" ? e + parseFloat(i) : parseFloat(i)
      }, r.prototype._swapEndStartRepeatValues = function (e) {
        var i = this._valuesStartRepeat[e],
          n = this._valuesEnd[e];
        typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = i
      }, r
    }(),
    rf = "18.6.4",
    nf = Jr.nextId,
    qe = go,
    sf = qe.getAll.bind(qe),
    of = qe.removeAll.bind(qe),
    af = qe.add.bind(qe),
    lf = qe.remove.bind(qe),
    cf = qe.update.bind(qe),
    yo = {
      Easing: Zt,
      Group: mo,
      Interpolation: Bt,
      now: mt,
      Sequence: Jr,
      nextId: nf,
      Tween: tf,
      VERSION: rf,
      getAll: sf,
      removeAll: of ,
      add: af,
      remove: lf,
      update: cf
    };
  const hf = {
    duration: 1e3,
    delay: 0,
    autoplay: !0,
    loop: !1,
    speed: null
  };
  class vo extends pt {
    constructor(e) {
      super(e);
      P(this, "type", G.Animate);
      P(this, "group", null);
      P(this, "positions", []);
      P(this, "value", {});
      P(this, "playingTween", null);
      P(this, "state", "ready");
      P(this, "lastTween", null);
      P(this, "firstTween", null);
      this.options = ye(hf, e), this.group = new yo.Group
    }
    _addedHook() {
      super._addedHook(), this.options.positions.forEach(e => {
        this.add(e)
      }), this.options.autoplay && this.start(), this.cancel = this._map.on("preUpdate", () => {
        this.group.update()
      })
    }
    add(e) {
      !e || (e.position || (e = {
        position: e
      }), this.positions.push(e), this.isPending && !this.options.loop && this._createTween(e, this.positions.length + 1, this.positions[this.positions.length - 1]))
    }
    get isPending() {
      return !!this.playingTween
    }
    stop() {
      this.playingTween && this.playingTween.stop(), this.playingTween = null
    }
    pause() {
      this.playingTween && this.playingTween.pause()
    }
    resume() {
      this.playingTween && this.playingTween.resume()
    }
    updatePosition() {}
    _createTween(e, i, n) {
      var a;
      let s = e.duration;
      if (ce(s)) {
        let c = (a = e.speed) != null ? a : this.options.speed;
        U(c) && (s = l.Cartesian3.distance(e.position, n.position) / (c / 3.6))
      }
      const o = new yo.Tween(this.value, this.group).delay(e.delay || 0).to(e.position, s != null ? s : this.options.duration).onUpdate(() => {
        this.updatePosition()
      }).onStart(() => {
        this.playingTween = o, this.fire("startItem", e)
      }).onComplete(() => {
        this.playingTween = null, this.fire("endItem", e)
      });
      this.firstTween || (this.firstTween = o), this.lastTween && this.lastTween.chain(o), this.lastTween = o
    }
    start() {
      if (this.group.removeAll(), this.firstTween = null, this.lastTween = null, this.positions.length < 2) return;
      const [e, ...i] = this.positions;
      Ue(this.value, e.position), i.forEach((n, s) => {
        this._createTween(n, s + 1, this.positions[s])
      }), this.firstTween.start(), this.options.loop && this.lastTween.chain(this.firstTween), this.graphics.forEach(n => {
        n.orientation = new uf(new l.CallbackProperty(() => this.value && Fr(this.value), !1)), n.position = new l.CallbackProperty(() => this.value && Fr(this.value), !1)
      })
    }
    destroy() {
      this.cancel && (this.cancel(), this.cancel = null), super.destroy()
    }
    async toJSON() {
      const e = await super.toJSON();
      return e.autoplay = this.options.autoplay, e.duration = this.options.duration, e.speed = this.options.speed, e.loop = this.options.loop, e.positions = this.options.positions, e
    }
  }
  class uf {
    constructor(e) {
      P(this, "positionPrev", null);
      P(this, "positionNow", null);
      P(this, "_preValue", null);
      this.property = e
    }
    getValue() {
      this.positionPrev = this.positionNow, this.positionNow = this.property.getValue();
      const e = this._getValue();
      return e && (this._preValue = e), e || this._preValue
    }
    _getValue() {
      if (!this.positionPrev || l.Cartesian3.equals(this.positionPrev, this.positionNow)) return;
      let e = l.Cartesian3.subtract(this.positionNow, this.positionPrev, new l.Cartesian3);
      e = l.Cartesian3.normalize(e, new l.Cartesian3);
      const i = l.Transforms.rotationMatrixFromPositionVelocity(this.positionNow, e, void 0, new l.Matrix3);
      return l.Quaternion.fromRotationMatrix(i, new l.Cartesian3)
    }
  }
  class _o extends Qr {
    constructor() {
      super(...arguments);
      P(this, "type", G.Tooltip)
    }
    set text(e) {
      e ? this.show() : (this.hide(), this.position = null), this.setStyle({
        html: `<div style="background: rgba(0,0,0,.8);border-radius: 3px;padding:2px 6px;font-size:10px;color: #fff;">${e}</div>`
      })
    }
    setStyle(e) {
      super.setStyle(e, G.DivPoint)
    }
  }
  class wo extends st {
    constructor(e = {}) {
      super(e);
      P(this, "type", G.Czml);
      this.dataSource = new l.CzmlDataSource, this.setOptions(e)
    }
    setOptions(e) {
      (e.url || e.data) && (e.url && this.setUrl(e.url), e.data && (this.readyPromise = this.dataSource.load(e.data), this.options.data = e.data), e.style || this.setStyle()), super.setOptions(e)
    }
    setUrl(e) {
      this.readyPromise = this.dataSource.load(e), this.options.url = e
    }
    async setStyle(e = {}) {
      !this.dataSource || e.url && this.setUrl(e.url)
    }
    async toJSON() {
      const e = await super.toJSON();
      return this.options.url && (e.url = this.options.url), this.options.data && (e.data = this.options.data), e
    }
    toData() {
      return this.options.url || this.options.data || ""
    }
    get boundingSphere() {
      return this._map ? this._map.getBoundingSphere(this.dataSource.entities.values) : new l.BoundingSphere
    }
  }
  class Co extends st {
    constructor(e = {}) {
      super(e);
      P(this, "type", G.Kml);
      this.dataSource = new l.KmlDataSource, this.setOptions(e)
    }
    setOptions(e) {
      (e.url || e.data) && (e.url && this.setUrl(e.url), e.data && (this.readyPromise = this.dataSource.load(e.data), this.options.data = e.data), e.style || this.setStyle()), super.setOptions(e)
    }
    setUrl(e) {
      this.readyPromise = this.dataSource.load(e), this.options.url = e
    }
    async setStyle(e = {}) {
      !this.dataSource || (e.url && this.setUrl(e.url), await this.readyPromise, this.readyPromise.then(i => {
        this.options.style = zt(this.style, e);
        const n = Ae(this.options.style, this.type),
          s = [G.Polyline, G.Polygon, G.Point, G.Billboard, G.Label].reduce((a, c) => (n[c] && (a[c] = Ae(n[c], c, {
            merge: !1
          })), a), {});

        function o(a) {
          Object.entries(s).forEach(([c, h]) => {
            a[c] && Object.keys(h).forEach(u => {
              a[c][u] = h[u]
            })
          })
        }
        i.entities.values.forEach(a => {
          o(a)
        })
      }))
    }
    async toJSON() {
      const e = await super.toJSON();
      return this.options.url && (e.url = this.options.url), this.options.data && (e.data = this.options.data), e
    }
    toData() {
      return this.options.url || this.options.data || ""
    }
    get boundingSphere() {
      return this._map ? this._map.getBoundingSphere(this.dataSource.entities.values) : new l.BoundingSphere
    }
  }
  class xo extends Ne {
    constructor(e = {}) {
      super();
      P(this, "type", G.PolylinePrimitive);
      let {
        positions: i,
        style: {
          width: n = 1,
          material: s,
          color: o = "#fff",
          visibleDepth: a = !0
        } = {}
      } = e;
      s || (s = new l.Material({
        fabric: {
          type: "Color",
          uniforms: {
            color: rt(o)
          }
        }
      })), this.primitive = new l.Primitive({
        geometryInstances: new l.GeometryInstance({
          geometry: new l.PolylineGeometry({
            positions: i.map(c => new R(c)),
            width: n,
            vertexFormat: l.PolylineMaterialAppearance.VERTEX_FORMAT
          })
        }),
        appearance: new l.PolylineMaterialAppearance({
          material: s,
          renderState: {
            depthTest: {
              enabled: a
            }
          }
        })
      })
    }
    setStyle() {}
    _updatePosition() {}
  }
  var bo = {
    exports: {}
  };
  (function (r, e) {
    (function (i, n) {
      r.exports = n()
    })(ve, function () {
      var i = 1e3,
        n = 6e4,
        s = 36e5,
        o = "millisecond",
        a = "second",
        c = "minute",
        h = "hour",
        u = "day",
        d = "week",
        p = "month",
        f = "quarter",
        m = "year",
        g = "date",
        y = "Invalid Date",
        x = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
        A = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
        _ = {
          name: "en",
          weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
          months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
          ordinal: function (T) {
            var D = ["th", "st", "nd", "rd"],
              k = T % 100;
            return "[" + T + (D[(k - 20) % 10] || D[k] || D[0]) + "]"
          }
        },
        v = function (T, D, k) {
          var W = String(T);
          return !W || W.length >= D ? T : "" + Array(D + 1 - W.length).join(k) + T
        },
        b = {
          s: v,
          z: function (T) {
            var D = -T.utcOffset(),
              k = Math.abs(D),
              W = Math.floor(k / 60),
              V = k % 60;
            return (D <= 0 ? "+" : "-") + v(W, 2, "0") + ":" + v(V, 2, "0")
          },
          m: function T(D, k) {
            if (D.date() < k.date()) return -T(k, D);
            var W = 12 * (k.year() - D.year()) + (k.month() - D.month()),
              V = D.clone().add(W, p),
              q = k - V < 0,
              Q = D.clone().add(W + (q ? -1 : 1), p);
            return +(-(W + (k - V) / (q ? V - Q : Q - V)) || 0)
          },
          a: function (T) {
            return T < 0 ? Math.ceil(T) || 0 : Math.floor(T)
          },
          p: function (T) {
            return {
              M: p,
              y: m,
              w: d,
              d: u,
              D: g,
              h,
              m: c,
              s: a,
              ms: o,
              Q: f
            } [T] || String(T || "").toLowerCase().replace(/s$/, "")
          },
          u: function (T) {
            return T === void 0
          }
        },
        C = "en",
        M = {};
      M[C] = _;
      var S = function (T) {
          return T instanceof E
        },
        H = function T(D, k, W) {
          var V;
          if (!D) return C;
          if (typeof D == "string") {
            var q = D.toLowerCase();
            M[q] && (V = q), k && (M[q] = k, V = q);
            var Q = D.split("-");
            if (!V && Q.length > 1) return T(Q[0])
          } else {
            var ie = D.name;
            M[ie] = D, V = ie
          }
          return !W && V && (C = V), V || !W && C
        },
        N = function (T, D) {
          if (S(T)) return T.clone();
          var k = typeof D == "object" ? D : {};
          return k.date = T, k.args = arguments, new E(k)
        },
        w = b;
      w.l = H, w.i = S, w.w = function (T, D) {
        return N(T, {
          locale: D.$L,
          utc: D.$u,
          x: D.$x,
          $offset: D.$offset
        })
      };
      var E = function () {
          function T(k) {
            this.$L = H(k.locale, null, !0), this.parse(k)
          }
          var D = T.prototype;
          return D.parse = function (k) {
            this.$d = function (W) {
              var V = W.date,
                q = W.utc;
              if (V === null) return new Date(NaN);
              if (w.u(V)) return new Date;
              if (V instanceof Date) return new Date(V);
              if (typeof V == "string" && !/Z$/i.test(V)) {
                var Q = V.match(x);
                if (Q) {
                  var ie = Q[2] - 1 || 0,
                    z = (Q[7] || "0").substring(0, 3);
                  return q ? new Date(Date.UTC(Q[1], ie, Q[3] || 1, Q[4] || 0, Q[5] || 0, Q[6] || 0, z)) : new Date(Q[1], ie, Q[3] || 1, Q[4] || 0, Q[5] || 0, Q[6] || 0, z)
                }
              }
              return new Date(V)
            }(k), this.$x = k.x || {}, this.init()
          }, D.init = function () {
            var k = this.$d;
            this.$y = k.getFullYear(), this.$M = k.getMonth(), this.$D = k.getDate(), this.$W = k.getDay(), this.$H = k.getHours(), this.$m = k.getMinutes(), this.$s = k.getSeconds(), this.$ms = k.getMilliseconds()
          }, D.$utils = function () {
            return w
          }, D.isValid = function () {
            return this.$d.toString() !== y
          }, D.isSame = function (k, W) {
            var V = N(k);
            return this.startOf(W) <= V && V <= this.endOf(W)
          }, D.isAfter = function (k, W) {
            return N(k) < this.startOf(W)
          }, D.isBefore = function (k, W) {
            return this.endOf(W) < N(k)
          }, D.$g = function (k, W, V) {
            return w.u(k) ? this[W] : this.set(V, k)
          }, D.unix = function () {
            return Math.floor(this.valueOf() / 1e3)
          }, D.valueOf = function () {
            return this.$d.getTime()
          }, D.startOf = function (k, W) {
            var V = this,
              q = !!w.u(W) || W,
              Q = w.p(k),
              ie = function (Ct, Te) {
                var ht = w.w(V.$u ? Date.UTC(V.$y, Te, Ct) : new Date(V.$y, Te, Ct), V);
                return q ? ht : ht.endOf(u)
              },
              z = function (Ct, Te) {
                return w.w(V.toDate()[Ct].apply(V.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Te)), V)
              },
              I = this.$W,
              O = this.$M,
              L = this.$D,
              Nt = "set" + (this.$u ? "UTC" : "");
            switch (Q) {
              case m:
                return q ? ie(1, 0) : ie(31, 11);
              case p:
                return q ? ie(1, O) : ie(0, O + 1);
              case d:
                var wt = this.$locale().weekStart || 0,
                  _i = (I < wt ? I + 7 : I) - wt;
                return ie(q ? L - _i : L + (6 - _i), O);
              case u:
              case g:
                return z(Nt + "Hours", 0);
              case h:
                return z(Nt + "Minutes", 1);
              case c:
                return z(Nt + "Seconds", 2);
              case a:
                return z(Nt + "Milliseconds", 3);
              default:
                return this.clone()
            }
          }, D.endOf = function (k) {
            return this.startOf(k, !1)
          }, D.$set = function (k, W) {
            var V, q = w.p(k),
              Q = "set" + (this.$u ? "UTC" : ""),
              ie = (V = {}, V[u] = Q + "Date", V[g] = Q + "Date", V[p] = Q + "Month", V[m] = Q + "FullYear", V[h] = Q + "Hours", V[c] = Q + "Minutes", V[a] = Q + "Seconds", V[o] = Q + "Milliseconds", V)[q],
              z = q === u ? this.$D + (W - this.$W) : W;
            if (q === p || q === m) {
              var I = this.clone().set(g, 1);
              I.$d[ie](z), I.init(), this.$d = I.set(g, Math.min(this.$D, I.daysInMonth())).$d
            } else ie && this.$d[ie](z);
            return this.init(), this
          }, D.set = function (k, W) {
            return this.clone().$set(k, W)
          }, D.get = function (k) {
            return this[w.p(k)]()
          }, D.add = function (k, W) {
            var V, q = this;
            k = Number(k);
            var Q = w.p(W),
              ie = function (O) {
                var L = N(q);
                return w.w(L.date(L.date() + Math.round(O * k)), q)
              };
            if (Q === p) return this.set(p, this.$M + k);
            if (Q === m) return this.set(m, this.$y + k);
            if (Q === u) return ie(1);
            if (Q === d) return ie(7);
            var z = (V = {}, V[c] = n, V[h] = s, V[a] = i, V)[Q] || 1,
              I = this.$d.getTime() + k * z;
            return w.w(I, this)
          }, D.subtract = function (k, W) {
            return this.add(-1 * k, W)
          }, D.format = function (k) {
            var W = this,
              V = this.$locale();
            if (!this.isValid()) return V.invalidDate || y;
            var q = k || "YYYY-MM-DDTHH:mm:ssZ",
              Q = w.z(this),
              ie = this.$H,
              z = this.$m,
              I = this.$M,
              O = V.weekdays,
              L = V.months,
              Nt = V.meridiem,
              wt = function (Te, ht, wi, Zi) {
                return Te && (Te[ht] || Te(W, q)) || wi[ht].slice(0, Zi)
              },
              _i = function (Te) {
                return w.s(ie % 12 || 12, Te, "0")
              },
              Ct = Nt || function (Te, ht, wi) {
                var Zi = Te < 12 ? "AM" : "PM";
                return wi ? Zi.toLowerCase() : Zi
              };
            return q.replace(A, function (Te, ht) {
              return ht || function (wi) {
                switch (wi) {
                  case "YY":
                    return String(W.$y).slice(-2);
                  case "YYYY":
                    return w.s(W.$y, 4, "0");
                  case "M":
                    return I + 1;
                  case "MM":
                    return w.s(I + 1, 2, "0");
                  case "MMM":
                    return wt(V.monthsShort, I, L, 3);
                  case "MMMM":
                    return wt(L, I);
                  case "D":
                    return W.$D;
                  case "DD":
                    return w.s(W.$D, 2, "0");
                  case "d":
                    return String(W.$W);
                  case "dd":
                    return wt(V.weekdaysMin, W.$W, O, 2);
                  case "ddd":
                    return wt(V.weekdaysShort, W.$W, O, 3);
                  case "dddd":
                    return O[W.$W];
                  case "H":
                    return String(ie);
                  case "HH":
                    return w.s(ie, 2, "0");
                  case "h":
                    return _i(1);
                  case "hh":
                    return _i(2);
                  case "a":
                    return Ct(ie, z, !0);
                  case "A":
                    return Ct(ie, z, !1);
                  case "m":
                    return String(z);
                  case "mm":
                    return w.s(z, 2, "0");
                  case "s":
                    return String(W.$s);
                  case "ss":
                    return w.s(W.$s, 2, "0");
                  case "SSS":
                    return w.s(W.$ms, 3, "0");
                  case "Z":
                    return Q
                }
                return null
              }(Te) || Q.replace(":", "")
            })
          }, D.utcOffset = function () {
            return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
          }, D.diff = function (k, W, V) {
            var q, Q = this,
              ie = w.p(W),
              z = N(k),
              I = (z.utcOffset() - this.utcOffset()) * n,
              O = this - z,
              L = function () {
                return w.m(Q, z)
              };
            switch (ie) {
              case m:
                q = L() / 12;
                break;
              case p:
                q = L();
                break;
              case f:
                q = L() / 3;
                break;
              case d:
                q = (O - I) / 6048e5;
                break;
              case u:
                q = (O - I) / 864e5;
                break;
              case h:
                q = O / s;
                break;
              case c:
                q = O / n;
                break;
              case a:
                q = O / i;
                break;
              default:
                q = O
            }
            return V ? q : w.a(q)
          }, D.daysInMonth = function () {
            return this.endOf(p).$D
          }, D.$locale = function () {
            return M[this.$L]
          }, D.locale = function (k, W) {
            if (!k) return this.$L;
            var V = this.clone(),
              q = H(k, W, !0);
            return q && (V.$L = q), V
          }, D.clone = function () {
            return w.w(this.$d, this)
          }, D.toDate = function () {
            return new Date(this.valueOf())
          }, D.toJSON = function () {
            return this.isValid() ? this.toISOString() : null
          }, D.toISOString = function () {
            return this.$d.toISOString()
          }, D.toString = function () {
            return this.$d.toUTCString()
          }, T
        }(),
        B = E.prototype;
      return N.prototype = B, [
        ["$ms", o],
        ["$s", a],
        ["$m", c],
        ["$H", h],
        ["$W", u],
        ["$M", p],
        ["$y", m],
        ["$D", g]
      ].forEach(function (T) {
        B[T[1]] = function (D) {
          return this.$g(D, T[0], T[1])
        }
      }), N.extend = function (T, D) {
        return T.$i || (T(D, E, N), T.$i = !0), N
      }, N.locale = H, N.isDayjs = S, N.unix = function (T) {
        return N(1e3 * T)
      }, N.en = M[C], N.Ls = M, N.p = {}, N
    })
  })(bo);
  var $r = bo.exports;
  class Ao extends pt {
    constructor(n = {}) {
      var s = n,
        {
          time: e
        } = s,
        i = re(s, ["time"]);
      super(j({
        time: e
      }, i));
      P(this, "type", G.PositionGroup);
      P(this, "_store", {});
      e || console.error("time\u5FC5\u4F20"), this._time = e
    }
    get isRuning() {
      return this._map ? this._map.viewer.clock.shouldAnimate : null
    }
    start() {
      this._map && (this._map.viewer.clock.shouldAnimate = !0)
    }
    stop() {
      this._map && (this._map.viewer.clock.shouldAnimate = !1)
    }
    _addedHook() {
      super._addedHook(), this.time = this._time
    }
    set time(e) {
      if (this._map) {
        this._map.viewer.clock.currentTime = this._formatTime(e);
        return
      }
      this._time = e
    }
    get time() {
      return this._time
    }
    updateGraphics(e, i = !1) {
      const {
        insert: n,
        remove: s,
        equal: o
      } = Oi(this.graphics, e, (a, c) => a.id === c.id);
      return n.forEach(a => {
        const c = new l.SampledPositionProperty;
        this.options.forwardExtrapolationType && (c.forwardExtrapolationType = l.ExtrapolationType[this.options.forwardExtrapolationType.toUpperCase()]), c.forwardExtrapolationType = l.ExtrapolationType.HOLD, c.backwardExtrapolationType = l.ExtrapolationType.HOLD;
        const h = this.addGraphic(se(j({}, a), {
          position: c
        }));
        this.update(h.id, {
          time: a.time,
          position: a.position
        })
      }), o.forEach(({
        oldVal: a,
        newVal: c
      }) => {
        if (c.type === G.Group) {
          a.updateGraphics(c.graphics);
          return
        }
        a.setOptions(se(j({}, c), {
          position: void 0
        })), this.update(a.id, {
          time: c.time,
          position: c.position
        })
      }), i && s.forEach(a => {
        this.removeGraphic(a)
      }), this
    }
    _formatTime(e) {
      return l.JulianDate.fromDate($r(e).toDate())
    }
    update(e, {
      time: i,
      position: n
    }) {
      i && n && (this._store[e] || (this._store[e] = {}), this._store[e][i] = n, this.getGraphic(e).position.addSample(this._formatTime(i), new R(Oe(n) ? n() : n)))
    }
    refresh() {
      Object.entries(this._store).forEach(([e, i]) => {
        const n = Object.keys(i).map(a => this._formatTime(a)),
          s = Object.values(i).map(a => Oe(a) ? a() : a);
        this.getGraphic(e).position.addSamples(n, s)
      })
    }
    destroy() {
      super.destroy(), this._store = null
    }
  }
  const Hi = {
    [G.Billboard]: qr,
    [G.Model]: Zs,
    [G.RoamLine]: no,
    [G.DivPoint]: Qr,
    [G.Tileset]: Gi,
    [G.Path]: oo,
    [G.Label]: Ot,
    [G.Ellipse]: Gr,
    [G.Circle]: zi,
    [G.Point]: Yr,
    [G.Polyline]: Se,
    [G.GeoJson]: ao,
    [G.Polygon]: Xr,
    [G.Box]: lo,
    [G.Corridor]: co,
    [G.Cylinder]: ho,
    [G.PolylineVolume]: uo,
    [G.Rectangle]: Fi,
    [G.Wall]: Kr,
    [G.Plane]: po,
    [G.Heatmap]: fo,
    [G.Group]: pt,
    [G.Animate]: vo,
    [G.Tooltip]: _o,
    [G.Czml]: wo,
    [G.Kml]: Co,
    [G.PolylinePrimitive]: xo,
    [G.PositionGroup]: Ao
  };
  var df = Object.freeze({
    __proto__: null,
    [Symbol.toStringTag]: "Module",
    GraphicMap: Hi,
    TooltipGraphic: _o,
    BillboardGraphic: qr,
    ModelGraphic: Zs,
    RoamLineGraphic: no,
    DivPointGraphic: Qr,
    TilesetGraphic: Gi,
    PathGraphic: oo,
    LabelGraphic: Ot,
    EllipseGraphic: Gr,
    CircleGraphic: zi,
    PointGraphic: Yr,
    PolyLineGraphic: Se,
    GeoJsonGraphic: ao,
    PolygonGraphic: Xr,
    BoxGraphic: lo,
    CorridorGraphic: co,
    CylinderGraphic: ho,
    PolylineVolumeGraphic: uo,
    RectangleGraphic: Fi,
    WallGraphic: Kr,
    PlaneGraphic: po,
    HeatmapGraphic: fo,
    GroupGraphic: pt,
    AnimateGraphic: vo,
    CzmlGraphic: wo,
    KmlGraphic: Co,
    PolylinePrimitiveGraphic: xo,
    PositionGroupGraphic: Ao
  });
  class ti extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        type: e,
        style: i,
        attr: n,
        parent: s = this._map
      } = this.options, o = Hi[e];
      o || console.error(`\u4E0D\u652F\u6301\u7684\u7C7B\u578B\uFF1A${e}`), this.graphic = new o({
        style: i,
        attr: n
      }), this.once("drawEnd", () => {
        this.graphic.position = this.points[0], s.addGraphic(this.graphic)
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(ti, "DefaultOptions", {
    minPointNum: 1,
    maxPointNum: 1,
    style: {
      pixelSize: 10,
      color: "#3388ff",
      opacity: 1,
      outline: !0,
      outlineColor: "#ffffff",
      outlineOpacity: .6,
      outlineWidth: 2,
      visibleDepth: !1
    }
  });
  class Po extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        style: e,
        attr: i,
        parent: n = this._map
      } = this.options;
      this.graphic = new Se({
        style: e,
        attr: i,
        positions: new l.CallbackProperty(() => this.points.concat(this.mousePoint).filter(Boolean), !1)
      }).addTo(n), this.once("drawEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const s = this.points;
          this.graphic.positions = new l.CallbackProperty(() => s, !1)
        }
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(Po, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 1 / 0,
    style: {
      lineType: "solid",
      color: "#3388ff",
      width: 2
    }
  });
  class So extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        style: e,
        attr: i,
        parent: n = this._map
      } = this.options;
      this.graphic = new Xr({
        style: e,
        attr: i,
        positions: new l.CallbackProperty(() => new l.PolygonHierarchy(this.points.concat(this.mousePoint).filter(Boolean)), !1)
      }).addTo(n), this.once("drawEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const s = this.points;
          this.graphic.positions = new l.CallbackProperty(() => new l.PolygonHierarchy(s), !1)
        }
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(So, "DefaultOptions", {
    minPointNum: 3,
    maxPointNum: 9999,
    style: {
      color: "#3388ff",
      opacity: .5,
      outlineWidth: 2,
      outlineColor: "#fff"
    }
  });
  class To extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        style: e,
        attr: i,
        parent: n = this._map
      } = this.options;
      this.graphic = new Fi({
        style: e,
        attr: i,
        positions: new l.CallbackProperty(() => {
          const s = this.points.concat(this.mousePoint).filter(Boolean);
          return s.length > 1 ? l.Rectangle.fromCartesianArray(s) : null
        }, !1)
      }).addTo(n), this.once("drawEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const s = this.points;
          this.graphic.positions = new l.CallbackProperty(() => l.Rectangle.fromCartesianArray(s), !1)
        }
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(To, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 2,
    style: {
      color: "#3388ff",
      opacity: .5,
      outlineWidth: 2,
      outlineColor: "#fff"
    }
  });
  class Mo extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        style: e,
        attr: i,
        parent: n = this._map
      } = this.options;
      this.graphic = new zi({
        style: se(j({}, e), {
          semiAxis: new l.CallbackProperty(() => {
            const s = [this.points[0], this.points[1] || this.mousePoint].filter(Boolean);
            if (s.length === 2) return l.Cartesian3.distance(...s) || void 0
          }, !1)
        }),
        attr: i,
        position: new l.CallbackProperty(() => {
          if ([this.points[0], this.points[1] || this.mousePoint].filter(Boolean).length === 2) return this.points[0]
        }, !1)
      }).addTo(n), this.once("drawEnd", () => {
        if (this.options.isRestorePositions) this.graphic.position = this.points[0], this.graphic.setStyle({
          semiAxis: l.Cartesian3.distance(...this.points)
        });
        else {
          const s = this.points,
            o = l.Cartesian3.distance(...s);
          this.graphic.position = new l.CallbackProperty(() => s[0], !1), this.graphic.setStyle({
            semiAxis: o
          })
        }
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(Mo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 2,
    style: {
      color: "#3388ff",
      opacity: .5,
      visibleDepth: !1,
      outlineColor: "#fff",
      outlineWidth: 2
    }
  });
  class Eo extends ti {}
  P(Eo, "DefaultOptions", {
    minPointNum: 1,
    maxPointNum: 1,
    style: {
      visibleDepth: !1
    }
  });
  class Do extends ti {}
  P(Do, "DefaultOptions", {
    minPointNum: 1,
    maxPointNum: 1,
    style: {
      visibleDepth: !1
    }
  });
  class ko extends ti {}
  P(ko, "DefaultOptions", {
    minPointNum: 1,
    maxPointNum: 1,
    style: {
      visibleDepth: !1
    }
  });
  class zo extends Dt {
    constructor(s) {
      var o = s,
        {
          map: e,
          id: i
        } = o,
        n = re(o, ["map", "id"]);
      super();
      P(this, "options", {});
      P(this, "point", null);
      P(this, "graphic", null);
      this.id = i, this._map = e, this.setOptions(ne(new.target.defaultOptions, n)), this.initGraphic()
    }
    setOptions(e) {
      const {
        position: i,
        style: n,
        attr: s,
        visible: o
      } = e;
      if (this.options = ne(this.options, e), U(i)) {
        const a = new R(i);
        this.options.style.clampToGround && a.clampToGround(this._map), this.point = a
      }
      U(n) && this.graphic && this.graphic.setStyle(n), U(s) && this.graphic && this.graphic.setAttr(s), U(o) && this.graphic && (o ? this.graphic.show() : this.graphic.hide())
    }
    initGraphic() {
      this.graphic = new Yr({
        position: new l.CallbackProperty(() => this.point, !1),
        style: this.options.style,
        attr: se(j({}, this.options.attr), {
          isAnchor: !0
        })
      }), this.bindEvent()
    }
    _mouseMoveEvent() {}
    bindEvent() {
      let e = !1,
        i = this.graphic.on("mouseenter", () => {
          e || this.fire("mouseenter")
        }),
        n = this.graphic.on("mouseleave", () => {
          e || this.fire("mouseleave")
        }),
        s = this.graphic.on("mousedown", a => {
          const c = a.point;
          if (!c) return;
          e = !0, this._map.disableCameraControl(), this.setCrosshairCursor(!0), this.graphic.hide(), this.fire("dragStart", {
            target: this.graphic,
            point: c
          });
          const h = this._map.on("mousemove", this._mouseMoveEvent.bind(this));
          this._map.once("mouseup", () => {
            h(), setTimeout(() => {
              this._map.enableCameraControl()
            }, 1e3 / 60 * 10), this.setCrosshairCursor(!1), this.graphic.show(), this.fire("dragEnd", {
              target: this.graphic
            }), this.graphic.once("mouseleave", () => {
              e = !1
            })
          })
        }),
        o = this.graphic.on("rClick", () => {
          this.fire("rClick")
        });
      this.once("destroy", () => {
        n(), i(), s(), o(), n = null, i = null, s = null, o = null
      })
    }
    setCrosshairCursor(e) {
      this._map.setCursor(e ? "crosshair" : "")
    }
    destroy() {
      this._map = null, this.options = null, this.point = null, super.destroy()
    }
  }
  class Io extends zo {
    _mouseMoveEvent(e) {
      const i = e.point;
      !i || (this.point = i, this.fire("drag", {
        target: this.graphic,
        point: i
      }))
    }
  }
  P(Io, "defaultOptions", {
    style: {
      pixelSize: 10,
      color: "#2745af",
      opacity: 1,
      outlineColor: "#ffffff",
      outlineOpacity: .6,
      outlineWidth: 2,
      visibleDepth: !1
    }
  });
  class Oo extends zo {
    _mouseMoveEvent(e) {
      const i = new R(this._map.camera.positionWC).height,
        n = l.Plane.fromPointNormal(this.point, l.Cartesian3.normalize(l.Cartesian3.subtract(this._map.camera.positionWC, this.point.clone().setHeight(i), new l.Cartesian3), new l.Cartesian3)),
        s = this._map.intersection(e.position, n).height,
        o = this.point.height;
      this.fire("drag", {
        target: this.graphic,
        height: s,
        offsetHeight: s - o
      })
    }
  }
  P(Oo, "defaultOptions", {
    style: {
      pixelSize: 10,
      color: "#ef21a7",
      opacity: 1,
      outlineColor: "#ffffff",
      outlineOpacity: .6,
      outlineWidth: 2,
      visibleDepth: !1
    }
  });
  const Ro = {
      Position: "position",
      Height: "height"
    },
    pf = {
      [Ro.Position]: Io,
      [Ro.Height]: Oo
    };
  class ff {
    constructor({
      map: e
    }) {
      P(this, "anchors", []);
      this.group = new pt({
        attr: {
          isHelper: !0
        }
      }).addTo(e), this._map = e
    }
    addAnchor(s) {
      var o = s,
        {
          type: e,
          event: i
        } = o,
        n = re(o, ["type", "event"]);
      const a = pf[e];
      if (!a) {
        console.log(`\u4E0D\u652F\u6301\u7C7B\u578B\u4E3A${e}\u7684anchor`);
        return
      }
      const c = new a(j({
        map: this._map
      }, n));
      return i && Object.entries(i).forEach(([h, u]) => {
        c.on(h, u)
      }), this.anchors.push(c), c
    }
    removeAnchor(e) {
      const i = this.anchors.findIndex(n => n.id === e.id);
      this.anchors.splice(i, 1)
    }
    updateAnchors(e) {
      const {
        insert: i,
        remove: n,
        equal: s
      } = Oi(this.anchors, e, (o, a) => o.id === a.id);
      i.forEach(o => {
        this.addAnchor(o)
      }), n.forEach(o => {
        this.removeAnchor(o)
      }), s.forEach(({
        oldVal: o,
        newVal: a
      }) => {
        o.setOptions(a)
      }), this.group.updateGraphics(this.anchors.map(o => o.graphic))
    }
    clearAllAnchor() {
      this.anchors.forEach(e => e.destroy()), this.group.removeAllGraphic(), this.anchors = []
    }
    hideAllAnchor() {
      this.group.getAllGraphics().forEach(e => {
        e.hide()
      })
    }
    showAllAnchor() {
      this.group.getAllGraphics().forEach(e => {
        e.show()
      })
    }
    hideHelperAnchor() {
      this.group.getAllGraphics().forEach(e => {
        e.attr.isHelper && e.hide()
      })
    }
    showHelperAnchor() {
      this.group.getAllGraphics().forEach(e => {
        e.attr.isHelper && e.show()
      })
    }
    destroy() {
      this.group.destroy(), this.group = null, this._map = null
    }
  }
  const ii = {
    Ready: "ready",
    Start: "Start",
    End: "End"
  };
  class gt extends Dt {
    constructor(s) {
      var o = s,
        {
          graphic: e,
          map: i
        } = o,
        n = re(o, ["graphic", "map"]);
      super();
      P(this, "points", []);
      this.graphic = e, this.options = n, this._map = i, this.anchorGroup = new ff({
        map: i
      }), this.toolTipMessage = ye(this.constructor.toolTipMessage, this.options.toolTipMessage)
    }
    start() {
      if (this.state === ii.Start) return console.log("\u5DF2\u5904\u4E8Estart\u72B6\u6001"), Promise.reject();
      this.state = ii.Start;
      const e = this.graphic.points;
      return this.fire("editStart", {
        target: this.graphic,
        points: e
      }), this.points = e, this._setupPositions(), this._updateAnchor(), new Promise(i => {
        this.once("editEnd", i)
      })
    }
    end() {
      if (this.state !== ii.Start) {
        console.log("\u6267\u884Cedit end\u65F6\uFF0C \u672A\u5904\u4E8Estart\u72B6\u6001");
        return
      }
      this.state = ii.End, this.tooltip = "", this.fire("editEnd", {
        target: this.graphic,
        points: this.points
      }), this.fire("editEndDone", {
        target: this.graphic,
        points: this.points
      })
    }
    set tooltip(e) {
      this._map.tooltip.text = e
    }
    _setupPositions() {}
    get clampToGround() {
      return this.graphic.graphicStyle.clampToGround
    }
    _updateAnchor() {}
    destroy() {
      this.state !== ii.End && (console.log("destroy \u4E4B\u524D \u672A\u5904\u4E8Eend\u72B6\u6001"), this.end()), this._map = null, this.options = null, this.graphic = null, this.anchorGroup.destroy(), this.anchorGroup = null, super.destroy()
    }
  }
  P(gt, "toolTipMessage", {
    positionHover: "\u62D6\u52A8\u8BE5\u70B9\u540E \u4FEE\u6539\u4F4D\u7F6E",
    midPositionHover: "\u62D6\u52A8\u8BE5\u70B9\u540E \u589E\u52A0\u70B9",
    end: "\u91CA\u653E\u540E \u5B8C\u6210\u4FEE\u6539",
    del: "<br/>\u53F3\u51FB\u5220\u9664\u70B9"
  });
  class yt extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.graphic.position = this.points[0]
    }
    _updateAnchor() {
      this.setCrosshairCursor(!0), this.graphic.hide(), this.tooltip = this.toolTipMessage.end, this._map.once("click", e => {
        const i = e.point;
        !i || (this.graphic.position = i, this.graphic.show(), this.setCrosshairCursor(!1), this.end())
      })
    }
    setCrosshairCursor(e) {
      this._map.setCursor(e ? "crosshair" : "")
    }
  }
  P(yt, "DefaultOptions", {
    minPointNum: 1,
    maxPointNum: 1
  }), P(yt, "toolTipMessage", {
    end: "\u70B9\u51FB\u540E \u5B8C\u6210\u4FEE\u6539"
  });
  class Bo extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.graphic.positions = new l.CallbackProperty(() => this.points, !1), this.once("editEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const e = this.points;
          this.graphic.positions = new l.CallbackProperty(() => e, !1)
        }
      })
    }
    _updateAnchor() {
      const e = [];
      for (let i = 0; i < this.points.length; i++) e.push({
        id: `position-${i}`,
        position: this.points[i],
        type: "position",
        visible: !0,
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end
          },
          drag: n => {
            this.points[i] = n.point, this.anchorGroup.hideAllAnchor()
          },
          dragEnd: () => {
            this.fire("editPoint", {
              target: this.graphic,
              point: this.points[i],
              points: this.points
            }), this._updateAnchor(), this.tooltip = ""
          },
          mouseenter: () => {
            this.points.length - 1 >= this.options.minPointNum ? this.tooltip = this.toolTipMessage.positionHover + this.toolTipMessage.del : this.tooltip = this.toolTipMessage.positionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          },
          rClick: () => {
            if (this.points.length - 1 >= this.options.minPointNum) {
              const [n] = this.points.splice(i, 1);
              this._updateAnchor(), this.fire("editRemovePoint", {
                target: this.graphic,
                point: n,
                points: this.points
              })
            }
          }
        },
        style: {
          clampToGround: this.clampToGround
        }
      }), this.points.length !== this.options.maxPointNum && i !== this.points.length - 1 && e.push({
        id: `mid-${i}`,
        position: l.Cartesian3.midpoint(this.points[i], this.points[i + 1], new l.Cartesian3),
        visible: !0,
        type: "position",
        style: {
          opacity: .4,
          clampToGround: this.clampToGround
        },
        attr: {
          isHelper: !0
        },
        event: {
          dragStart: n => {
            this.points.splice(i + 1, 0, n.point), this.anchorGroup.hideAllAnchor(), this.tooltip = this.toolTipMessage.end
          },
          drag: n => {
            this.points[i + 1] = n.point
          },
          dragEnd: () => {
            this.tooltip = "", this.fire("editAddPoint", {
              target: this.graphic,
              point: this.points[i + 1],
              points: this.points
            }), this._updateAnchor()
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.midPositionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        }
      });
      this.anchorGroup.updateAnchors(e)
    }
  }
  P(Bo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 9999
  });
  class Lo extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.graphic.positions = new l.CallbackProperty(() => new l.PolygonHierarchy(this.points), !1), this.once("editEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const e = this.points;
          this.graphic.positions = new l.CallbackProperty(() => new l.PolygonHierarchy(e), !1)
        }
      })
    }
    _updateAnchor() {
      const e = this.points,
        i = [];
      for (let n = 0; n < this.points.length; n++) i.push({
        id: `position-${n}`,
        position: e[n],
        type: "position",
        visible: !0,
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end
          },
          drag: s => {
            this.points[n] = s.point, this.anchorGroup.hideAllAnchor()
          },
          dragEnd: () => {
            this.fire("editPoint", {
              target: this.graphic,
              point: this.points[n],
              points: this.points
            }), this._updateAnchor(), this.tooltip = ""
          },
          mouseenter: () => {
            this.points.length - 1 >= this.options.minPointNum ? this.tooltip = this.toolTipMessage.positionHover + this.toolTipMessage.del : this.tooltip = this.toolTipMessage.positionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          },
          rClick: () => {
            if (this.points.length - 1 >= this.options.minPointNum) {
              const [s] = this.points.splice(n, 1);
              this._updateAnchor(), this.fire("editRemovePoint", {
                target: this.graphic,
                point: s,
                points: this.points
              })
            }
          }
        },
        style: {
          clampToGround: this.clampToGround
        }
      }), this.points.length !== this.options.maxPointNum && i.push({
        id: `mid-${n}`,
        position: l.Cartesian3.midpoint(e[n], e[(n + 1) % this.points.length], new l.Cartesian3),
        visible: !0,
        type: "position",
        style: {
          opacity: .4,
          clampToGround: this.clampToGround
        },
        attr: {
          isHelper: !0
        },
        event: {
          dragStart: s => {
            this.points.splice(n + 1, 0, s.point), this.anchorGroup.hideAllAnchor(), this.tooltip = this.toolTipMessage.end
          },
          drag: s => {
            this.points[n + 1] = s.point
          },
          dragEnd: () => {
            this.tooltip = "", this.fire("editAddPoint", {
              target: this.graphic,
              point: this.points[n + 1],
              points: this.points
            }), this._updateAnchor()
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.midPositionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        }
      });
      this.anchorGroup.updateAnchors(i)
    }
  }
  P(Lo, "DefaultOptions", {
    minPointNum: 3,
    maxPointNum: 9999
  });
  class mf extends yt {}
  class gf extends yt {}
  class yf extends yt {}
  class Zr extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.points = [this.graphic.point, this.graphic.getOuterPositions()[0]], this.graphic.setOptions({
        position: new l.CallbackProperty(() => this.points[0], !1)
      }), this.once("editEnd", () => {
        if (this.options.isRestorePositions) this.graphic.position = this.points[0];
        else {
          const e = this.points;
          this.graphic.position = new l.CallbackProperty(() => e[0], !1)
        }
      })
    }
    _updateAnchor() {
      const e = [{
        id: "position",
        position: this.points[0],
        type: "position",
        visible: !0,
        style: {
          clampToGround: this.clampToGround
        },
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end, this.anchorGroup.hideAllAnchor()
          },
          drag: i => {
            this.points[0] = i.point
          },
          dragEnd: () => {
            this.points = [this.points[0], this.graphic.getOuterPositions()[0]], this.fire("editPoint", {
              target: this.graphic,
              point: this.points[0],
              points: this.points
            }), this._updateAnchor(), this.tooltip = ""
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.positionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        }
      }, {
        id: "radius",
        position: this.points[1],
        type: "position",
        visible: !0,
        style: {
          clampToGround: this.clampToGround,
          color: "yellow"
        },
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end
          },
          drag: i => {
            this.points[1] = i.point, this.graphic.setStyle({
              semiAxis: l.Cartesian3.distance(...this.points)
            })
          },
          dragEnd: () => {
            this.fire("editPoint", {
              target: this.graphic,
              point: this.points[1],
              points: this.points
            }), this.tooltip = ""
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.circleHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        },
        attr: {
          isHelper: !0
        }
      }];
      this.anchorGroup.updateAnchors(e)
    }
  }
  P(Zr, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 2
  }), P(Zr, "toolTipMessage", {
    positionHover: "\u62D6\u52A8\u8BE5\u70B9\u540E \u4FEE\u6539\u4F4D\u7F6E",
    circleHover: "\u62D6\u52A8\u8BE5\u70B9\u540E \u4FEE\u6539\u534A\u5F84",
    end: "\u91CA\u653E\u540E \u5B8C\u6210\u4FEE\u6539"
  });
  class Go extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.graphic.positions = new l.CallbackProperty(() => l.Rectangle.fromCartesianArray(this.points), !1), this.once("editEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const e = this.points;
          this.graphic.positions = new l.CallbackProperty(() => l.Rectangle.fromCartesianArray(e), !1)
        }
      })
    }
    _updateAnchor() {
      const e = this.points,
        i = [];
      for (let n = 0; n < this.points.length; n++) i.push({
        id: `position-${n}`,
        position: e[n],
        type: "position",
        visible: !0,
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end
          },
          drag: s => {
            this.points[n] = s.point
          },
          dragEnd: () => {
            this.fire("editPoint", {
              target: this.graphic,
              point: this.points[n],
              points: this.points
            }), this._updateAnchor(), this.tooltip = ""
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.positionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        },
        style: {
          clampToGround: this.clampToGround
        }
      });
      this.anchorGroup.updateAnchors(i)
    }
  }
  P(Go, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 2
  });
  class Fo extends at {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _initGraphic() {
      const {
        style: e,
        attr: i,
        parent: n = this._map
      } = this.options;
      this.graphic = new Kr({
        style: e,
        attr: i,
        positions: new l.CallbackProperty(() => this.points.concat(this.mousePoint).filter(Boolean), !1)
      }).addTo(n), this.once("drawEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const s = this.points;
          this.graphic.positions = new l.CallbackProperty(() => s, !1)
        }
      }), this.once("drawCancel", () => {
        this.graphic.destroy()
      })
    }
  }
  P(Fo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 9999,
    style: {
      color: "#3388ff",
      diffHeight: 10
    }
  });
  class Ho extends gt {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    _setupPositions() {
      this.graphic.positions = new l.CallbackProperty(() => this.points, !1), this.once("editEnd", () => {
        if (this.options.isRestorePositions) this.graphic.positions = this.points.filter(Boolean);
        else {
          const e = this.points;
          this.graphic.positions = new l.CallbackProperty(() => e, !1)
        }
      })
    }
    _updateAnchor() {
      var o;
      const e = [],
        i = this.graphic.style.height,
        n = this.points.map(a => a.clone().setHeight(i));
      let s = (o = this.graphic.style.diffHeight) != null ? o : 0;
      for (let a = 0; a < n.length; a++) e.push({
        id: `position-${a}`,
        position: n[a],
        type: "position",
        visible: !0,
        event: {
          dragStart: () => {
            this.tooltip = this.toolTipMessage.end
          },
          drag: c => {
            this.points[a] = c.point, this.anchorGroup.hideAllAnchor()
          },
          dragEnd: () => {
            this.fire("editPoint", {
              target: this.graphic,
              point: this.points[a],
              points: this.points
            }), this._updateAnchor(), this.tooltip = ""
          },
          mouseenter: () => {
            this.points.length - 1 >= this.options.minPointNum ? this.tooltip = this.toolTipMessage.positionHover + this.toolTipMessage.del : this.tooltip = this.toolTipMessage.positionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          },
          rClick: () => {
            if (this.points.length - 1 >= this.options.minPointNum) {
              const [c] = this.points.splice(a, 1);
              this._updateAnchor(), this.fire("editRemovePoint", {
                target: this.graphic,
                point: c,
                points: this.points
              })
            }
          }
        },
        style: {
          clampToGround: this.clampToGround
        }
      }), e.push({
        id: `height-${a}`,
        position: n[a].clone().addHeight(s),
        type: "height",
        visible: !0,
        event: {
          dragStart: () => {
            var c;
            s = (c = this.graphic.style.diffHeight) != null ? c : 0
          },
          drag: ({
            offsetHeight: c
          }) => {
            this.graphic.setStyle({
              diffHeight: c + s
            }), this.anchorGroup.hideAllAnchor()
          },
          dragEnd: () => {
            this.fire("editHeight", {
              target: this.graphic,
              point: this.points[a],
              points: this.points
            }), this._updateAnchor()
          }
        },
        style: {
          clampToGround: this.clampToGround
        }
      }), this.points.length !== this.options.maxPointNum && a !== n.length - 1 && e.push({
        id: `mid-${a}`,
        position: l.Cartesian3.midpoint(n[a], n[a + 1], new l.Cartesian3),
        visible: !0,
        type: "position",
        style: {
          opacity: .4,
          clampToGround: this.clampToGround
        },
        attr: {
          isHelper: !0
        },
        event: {
          dragStart: c => {
            this.points.splice(a + 1, 0, c.point), this.anchorGroup.hideAllAnchor(), this.tooltip = this.toolTipMessage.end
          },
          drag: c => {
            this.points[a + 1] = c.point
          },
          dragEnd: () => {
            this.tooltip = "", this.fire("editAddPoint", {
              target: this.graphic,
              point: this.points[a + 1],
              points: this.points
            }), this._updateAnchor()
          },
          mouseenter: () => {
            this.tooltip = this.toolTipMessage.midPositionHover
          },
          mouseleave: () => {
            this.tooltip = ""
          }
        }
      });
      this.anchorGroup.updateAnchors(e)
    }
  }
  P(Ho, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 9999
  });
  class vf extends at {
    _initGraphic() {
      this.options.initGraphic && this.options.initGraphic.call(this), this.graphic || (this.graphic = {})
    }
  }
  const fe = {
      Ready: "ready",
      Draw: "draw",
      Edit: "edit"
    },
    _f = {
      [G.Point]: {
        DrawClass: ti,
        EditClass: yt
      },
      [G.Polyline]: {
        DrawClass: Po,
        EditClass: Bo
      },
      [G.Polygon]: {
        DrawClass: So,
        EditClass: Lo
      },
      [G.Circle]: {
        DrawClass: Mo,
        EditClass: Zr
      },
      [G.Billboard]: {
        DrawClass: ko,
        EditClass: mf
      },
      [G.Label]: {
        DrawClass: Eo,
        EditClass: gf
      },
      [G.Rectangle]: {
        DrawClass: To,
        EditClass: Go
      },
      [G.Model]: {
        DrawClass: Do,
        EditClass: yf
      },
      [G.Wall]: {
        DrawClass: Fo,
        EditClass: Ho
      },
      custom: {
        DrawClass: vf
      }
    };
  class No extends Dt {
    constructor({
      map: e
    }) {
      super();
      P(this, "state", fe.Ready);
      P(this, "graphics", []);
      P(this, "effects", []);
      P(this, "isContinued", null);
      P(this, "worker", null);
      this._map = e, this.once("destroy", e.on("click", i => {
        var s;
        const n = i.targetGraphic;
        if (this.state !== fe.Draw && !(this.state === fe.Edit && ((s = this.worker) == null ? void 0 : s.graphic) === n)) {
          if (n && n.hasEdit) {
            this.edit(n);
            return
          }
          n && n.attr.isAnchor || this.worker instanceof yt || this.state !== fe.Ready && this.finish()
        }
      }))
    }
    draw(o) {
      var a = o,
        {
          isAutoEditing: e,
          isContinued: i,
          hasEdit: n = !1
        } = a,
        s = re(a, ["isAutoEditing", "isContinued", "hasEdit"]);
      if (this.state !== fe.Ready && this.finish(), this.state = fe.Draw, this._createWorker(s), !this.worker) {
        this.state = fe.Ready;
        return
      }
      return this.worker.once("drawEndDone drawCancel", ({
        target: c
      }, h) => {
        if (this._clearWorker(), h === "drawEndDone") {
          if (c.hasEdit = n, this.graphics.push(c), e) {
            this.edit(c, s);
            return
          }
          i ? this.draw(...arguments) : this.isContinued = null;
          return
        }
        this.isContinued = null
      }), this.isContinued = !!i, this.worker.start()
    }
    _createWorker(e) {
      this.worker && (console.log("_createWorker\u5B58\u5728\u975E\u6CD5\u7684worker", this.worker), this.worker.destroy(), this.worker = null);
      const i = _f[e.type];
      if (!i) {
        console.error(`drawTool\u6682\u4E0D\u652F\u6301type\u4E3A${e.type}\u7684\u56FE\u5F62`);
        return
      }
      this.state === fe.Draw && (this.worker = new i.DrawClass(se(j({}, e), {
        map: this._map
      })), this.worker.on("drawStart drawPoint drawRemovePoint drawEnd drawCancel", (n, s) => {
        this.fire(s, n)
      })), this.state === fe.Edit && (this.worker = new i.EditClass(se(j({}, e), {
        map: this._map
      })), this.worker.on("editStart editAddPoint editPoint editHeight editRemovePoint editEnd", (n, s) => {
        this.fire(s, n)
      }))
    }
    edit(e, i) {
      var n;
      if (this.state === fe.Edit && e === ((n = this.worker) == null ? void 0 : n.graphic)) {
        console.log("edit \u540C\u4E00\u4E2Agraphic");
        return
      }
      if (this.state !== fe.Ready && this.finish(), this.state = fe.Edit, this._createWorker(j({
          graphic: e,
          type: e.type
        }, i)), !this.worker) {
        this.state = fe.Ready;
        return
      }
      return this.worker.once("editEndDone", () => {
        this._clearWorker()
      }), this.worker.start()
    }
    finish() {
      this.state === fe.Draw && this.worker && this.worker.end(), this.state === fe.Edit && this.worker && this.worker.end(), this._clearWorker()
    }
    _clearWorker() {
      this.worker && (this.worker.destroy(), this.worker = null), this.state = fe.Ready
    }
    clear() {
      this.state !== fe.Ready && this.finish(), this.graphics.forEach(e => {
        var i;
        (i = e == null ? void 0 : e.destroy) == null || i.call(e)
      }), this.graphics = []
    }
    destroy() {
      this.state !== fe.Ready && this.finish(), this.graphics = [], super.destroy()
    }
  }
  const en = function (r, e) {
      if (r == null) return "";
      (e == null || e === "auto") && (r < 1e3 ? e = "m" : e = "km");
      let i = "";
      switch (e) {
        default:
        case "m":
          i = `${r.toFixed(2)}\u7C73`;
          break;
        case "km":
          i = `${(r*.001).toFixed(2)}\u516C\u91CC`;
          break;
        case "mile":
          i = `${(r*54e-5).toFixed(2)}\u6D77\u91CC`;
          break;
        case "zhang":
          i = `${(r*.3).toFixed(2)}\u4E08`;
          break
      }
      return i
    },
    wf = (r, e) => `\u9AD8\u5EA6\u5DEE:${en(r,e)}`;

  function Cf({
    totalDistance: r,
    unit: e,
    partDistance: i
  }) {
    let n = en(r, e);
    if (r !== i) {
      const s = en(i, e);
      n = `${n}
(+${s})`
    }
    return n
  }

  function xf(r, e) {
    if (r == null) return "";
    (e == null || e == "auto") && (r < 1e6 ? e = "m" : e = "km");
    let i = "";
    switch (e) {
      default:
      case "m":
        i = `${r.toFixed(2)}\u5E73\u65B9\u7C73`;
        break;
      case "km":
        i = `${(r/1e6).toFixed(2)}\u5E73\u65B9\u516C\u91CC`;
        break;
      case "mu":
        i = `${(r*.0015).toFixed(2)}\u4EA9`;
        break;
      case "ha":
        i = `${(r*1e-4).toFixed(2)}\u516C\u9877`;
        break
    }
    return i
  }

  function bf(r) {
    return `\u89D2\u5EA6\uFF1A${r}\xB0`
  }
  class Ye {
    constructor({
      map: e
    }) {
      this._map = e, this._parent = e.addGraphic({
        type: "group",
        attr: {
          isHelper: !0
        }
      })
    }
    finish() {
      this._map.drawTool.finish()
    }
    destroy() {
      this._map = null, this._parent && (this._parent.destroy(), this._parent = null), this.graphic && (this.graphic.destroy(), this.graphic = null)
    }
  }
  class Af extends Ye {
    constructor() {
      super(...arguments);
      P(this, "labelGraphics", [])
    }
    start({
      lineStyle: e = {},
      labelStyle: i = {},
      unit: n,
      splitNum: s,
      format: o = Cf,
      clampToGround: a = !1
    } = {}) {
      return new Promise(c => {
        const h = this._map.drawTool;
        h.draw({
          type: "polyline",
          style: se(j({}, e), {
            clampToGround: a
          }),
          parent: this._parent
        }).then(({
          target: p
        }) => {
          this.graphic = p
        });
        const u = h.on("drawPoint", p => {
            const f = new Ot({
              position: p.point,
              style: j({
                text: "",
                color: "#ffffff",
                fontSize: 18,
                outlineColor: "#000000",
                outlineWidth: 3,
                pixelOffset: [0, -15],
                visibleDepth: !1
              }, i)
            }).addTo(this._parent);
            let m = p.points;
            if (m.length === 1) f.setStyle({
              text: "\u8D77\u70B9"
            });
            else {
              let g = ft(m),
                y = ft([m[m.length - 2], m[m.length - 1]]);
              y < .001 && f.hide(), f.setOptions({
                style: {
                  text: o({
                    unit: n,
                    partDistance: y,
                    totalDistance: g
                  })
                },
                attr: {
                  partDistance: y
                }
              })
            }
            this.labelGraphics.push(f)
          }),
          d = h.on("drawRemovePoint", () => {
            this.labelGraphics.pop().destroy()
          });
        h.once("drawEnd", p => {
          if (u(), d(), a) {
            const f = 1.2;
            let m = 0;
            const g = this.labelGraphics,
              y = p.points;
            Kp({
              viewer: this._map.viewer,
              positions: y,
              splitNum: s,
              calbakStep: function (A, _, v) {
                let b = ft(A);
                _ && (b = b * f), m += b, v++;
                let C = g[v];
                C && (C.setOptions({
                  style: {
                    text: o({
                      unit: n,
                      partDistance: b,
                      totalDistance: m
                    })
                  },
                  attr: {
                    partDistance: b,
                    totalDistance: m
                  }
                }), C.setStyle({}))
              },
              calbakEnd: () => {
                c({
                  distance: m,
                  points: this.labelGraphics.map(x => ({
                    position: x.point,
                    distance: x.attr.totalDistance
                  })),
                  group: this._parent
                })
              }
            })
          } else c({
            distance: this.labelGraphics.reduce((f, m) => f + m.attr.partDistance || 0, 0),
            points: this.labelGraphics.map(f => ({
              position: f.point,
              distance: f.attr.partDistance || 0
            })),
            group: this._parent
          })
        })
      })
    }
    destroy() {
      super.destroy(), this.labelGraphics && (this.labelGraphics = null)
    }
  }
  class Pf extends Ye {
    start({
      lineStyle: e = {},
      labelStyle: i = {},
      unit: n,
      format: s = wf
    } = {}) {
      return new Promise((o, a) => {
        this._map.drawTool.draw({
          type: "polyline",
          minPointNum: 2,
          maxPointNum: 2,
          style: j({
            color: "#ffff00"
          }, e),
          parent: this._parent
        }).then(({
          target: h,
          points: u
        }) => {
          this.graphic = h;
          const d = Math.abs(u[0].height - u[1].height);
          this._parent.addGraphic({
            type: "label",
            position: h.center.addHeight(5),
            style: j({
              text: s(d, n),
              fontSize: 18,
              outlineColor: "#000",
              verticalOrigin: "BOTTOM",
              color: "#ffffff",
              outlineWidth: 3,
              visibleDepth: !1
            }, i)
          }), o({
            height: d,
            target: h,
            group: this._parent
          })
        }).catch(() => {
          a()
        })
      })
    }
  }
  class Sf extends Ye {
    start({
      polygonStyle: e = {},
      labelStyle: i = {},
      unit: n,
      format: s = xf,
      computedType: o
    } = {}) {
      return new Promise((a, c) => {
        this._map.drawTool.draw({
          type: "polygon",
          style: j({}, e),
          parent: this._parent
        }).then(({
          target: u,
          points: d
        }) => {
          let p;
          o === "triangulation" ? p = Tf(d.map(f => [f.x, f.y, f.z])) : p = Hh(d.map(f => f.toLatLngArray())), new Ot({
            position: u.center,
            style: j({
              text: s(p, n),
              color: "#ffffff",
              fontSize: 18,
              outlineColor: "#000000",
              outlineWidth: 3,
              pixelOffset: [0, -15],
              visibleDepth: !1
            }, i)
          }).addTo(this._parent), a({
            area: p,
            target: u,
            group: this._parent
          })
        }).catch(() => {
          c()
        })
      })
    }
  }

  function Tf(r) {
    let e = r.length,
      i = 0;
    for (let n = 1; n < e - 1; n++) {
      let s = r[0],
        o = r[n],
        a = r[n + 1],
        c = [o[0] - s[0], o[1] - s[1], o[2] - s[2]],
        h = [a[0] - s[0], a[1] - s[1], a[2] - s[2]],
        u = [c[1] * h[2] - c[2] * h[1], c[2] * h[0] - c[0] * h[2], c[0] * h[1] - c[1] * h[0]];
      i += Math.sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]) / 2
    }
    return i
  }
  class Mf extends Ye {
    start({
      lineStyle: e = {},
      dashLineStyle: i = {},
      labelStyle: n = {},
      format: s = bf
    } = {}) {
      return new Promise((o, a) => {
        this._map.drawTool.draw({
          type: "polyline",
          minPointNum: 2,
          maxPointNum: 2,
          style: j({
            color: "#ffff00",
            width: 5,
            material: {
              type: "PolylineArrow",
              color: "yellow"
            }
          }, e),
          parent: this._parent
        }).then(({
          target: h,
          points: u
        }) => {
          this.graphic = h;
          const d = Nh(...u),
            p = _h(...u, -d);
          this._parent.addGraphic({
            type: "polyline",
            positions: [u[0], p],
            style: j({
              width: 2,
              material: {
                type: "PolylineDash",
                color: "red"
              }
            }, i)
          }), this._parent.addGraphic({
            type: "label",
            position: h.center.addHeight(5),
            style: j({
              text: s(d),
              fontSize: 18,
              outlineColor: "#000",
              verticalOrigin: "BOTTOM",
              color: "#ffffff",
              outlineWidth: 3,
              visibleDepth: !1
            }, n)
          }), o({
            angle: d,
            target: h,
            group: this._parent
          })
        }).catch(() => {
          a()
        })
      })
    }
  }
  const Uo = {
    fontSize: 20,
    color: "#f3f300",
    outlineWidth: 1,
    outlineColor: "#000",
    visibleDepth: !1
  };
  class Vo extends Ye {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    start() {
      return this._map.drawTool.draw({
        type: "custom",
        minPointNum: 2,
        maxPointNum: 1 / 0,
        parent: this._parent,
        initGraphic() {
          const {
            parent: i = this._map
          } = this.options;
          this.graphic = i.addGraphic({
            type: "group"
          });
          const n = new Se({
            style: {
              color: "#3388ff",
              label: se(j({}, Uo), {
                text: () => {
                  const o = +n.computedLength().toFixed(2);
                  if (o !== 0) return `${o}m`
                }
              })
            },
            positions: () => {
              if (!this.mousePoint) return;
              const o = this.drawPoints;
              if (o.length === 1) return;
              const a = Math.max(...o.map(c => c.height));
              return o.slice(-2).map(c => c.clone().setHeight(a))
            }
          }).addTo(this.graphic);
          new Se({
            style: {
              color: "#b242fd"
            },
            positions: () => {
              if (!this.mousePoint) return;
              const o = this.drawPoints,
                a = Math.max(...o.map(c => c.height));
              return [this.mousePoint, this.mousePoint.clone().setHeight(a)]
            }
          }).addTo(this.graphic);
          const s = this.graphic.addGraphic({
            type: "group"
          });
          this.on("drawRemovePoint,drawPoint", () => {
            s.removeAllGraphic(), this.points.forEach((o, a, c) => {
              if (new Se({
                  style: {
                    color: "#b242fd"
                  },
                  positions: () => {
                    const u = Math.max(...this.drawPoints.map(d => d.height));
                    return [o, o.clone().setHeight(u)]
                  }
                }).addTo(s), a === 0) return;
              const h = s.addGraphic({
                type: "polyline",
                style: {
                  color: "#3388ff",
                  label: se(j({}, Uo), {
                    text: () => `${h.computedLength().toFixed(2)}m`
                  })
                },
                positions: () => {
                  const u = Math.max(...this.drawPoints.map(d => d.height));
                  return [c[a - 1].clone().setHeight(u), o.clone().setHeight(u)]
                }
              })
            })
          })
        }
      })
    }
    destroy() {
      super.destroy()
    }
  }
  P(Vo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 1 / 0
  });
  const Wo = {
    fontSize: 20,
    color: "#f3f300",
    outlineWidth: 1,
    outlineColor: "#000",
    visibleDepth: !1
  };
  class jo extends Ye {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    start() {
      return this._map.drawTool.draw({
        type: "custom",
        minPointNum: 2,
        maxPointNum: 2,
        parent: this._parent,
        initGraphic() {
          const {
            parent: i = this._map
          } = this.options;
          this.graphic = i.addGraphic({
            type: "group"
          }), new Se({
            style: {
              color: "#3388ff"
            },
            positions: () => {
              if (!this.mousePoint) return;
              const s = this.drawPoints;
              if (s.length === 1) return;
              const o = Math.max(...s.map(a => a.height));
              return s.slice(-2).map(a => a.clone().setHeight(o))
            }
          }).addTo(this.graphic), new Se({
            style: {
              color: "#b242fd",
              label: se(j({}, Wo), {
                text: () => {
                  const s = Math.max(...this.drawPoints.map(c => c.height)),
                    o = Math.min(...this.drawPoints.map(c => c.height)),
                    a = +Math.abs(s - o).toFixed(2);
                  if (a !== 0) return `${a}m`
                }
              })
            },
            positions: () => {
              if (!this.mousePoint) return;
              const s = this.drawPoints,
                o = Math.max(...s.map(a => a.height));
              return [this.mousePoint, this.mousePoint.clone().setHeight(o)]
            }
          }).addTo(this.graphic);
          const n = this.graphic.addGraphic({
            type: "group"
          });
          this.on("drawRemovePoint,drawPoint", () => {
            n.removeAllGraphic(), this.points.forEach((s, o, a) => {
              new Se({
                style: {
                  color: "#b242fd",
                  label: o === 0 ? void 0 : se(j({}, Wo), {
                    text: () => {
                      const c = Math.max(...this.drawPoints.map(u => u.height)),
                        h = Math.min(...this.drawPoints.map(u => u.height));
                      return `${+Math.abs(c-h).toFixed(2)}m`
                    }
                  })
                },
                positions: () => {
                  const c = Math.max(...this.drawPoints.map(h => h.height));
                  return [s, s.clone().setHeight(c)]
                }
              }).addTo(n), o !== 0 && n.addGraphic({
                type: "polyline",
                style: {
                  color: "#3388ff"
                },
                positions: () => {
                  const c = Math.max(...this.drawPoints.map(h => h.height));
                  return [a[o - 1].clone().setHeight(c), s.clone().setHeight(c)]
                }
              })
            })
          })
        }
      })
    }
    destroy() {
      super.destroy()
    }
  }
  P(jo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 1 / 0
  });
  const Ni = {
    fontSize: 20,
    color: "#f3f300",
    outlineWidth: 1,
    outlineColor: "#000",
    visibleDepth: !1
  };
  class Ef extends Ye {
    start() {
      return this._map.drawTool.draw({
        type: "custom",
        minPointNum: 2,
        maxPointNum: 2,
        parent: this._parent,
        initGraphic() {
          const {
            parent: i = this._map
          } = this.options;
          this.graphic = i.addGraphic({
            type: "group"
          }), new Ot({
            style: j({
              text: () => {
                const a = this.drawPoints;
                if (a.length !== 2) return;
                const c = Math.abs(a[0].height - a[1].height),
                  h = ft(a);
                return `${(Math.asin(c/h)*(180/Math.PI)).toFixed(2)}\xB0`
              }
            }, Ni),
            position: () => {
              const a = this.drawPoints;
              return a.length !== 2 ? void 0 : a.reduce((h, u) => u.height > h.height ? u : h, {
                height: -1 / 0
              })
            }
          }).addTo(this.graphic);
          const n = new Se({
              style: {
                color: "#ef8518",
                label: j({
                  text: () => this.drawPoints.length === 2 ? `${n.computedLength().toFixed(2)}m` : ""
                }, Ni)
              },
              positions: () => {
                const a = this.drawPoints,
                  c = Math.max(...a.map(h => h.height));
                return a.map(h => h.clone().setHeight(c))
              }
            }).addTo(this.graphic),
            s = new Se({
              style: {
                color: "#ef8518",
                label: se(j({}, Ni), {
                  text: () => {
                    if (this.drawPoints.length === 2) return `${s.computedLength().toFixed(2)}m`
                  }
                })
              },
              positions: () => {
                const a = this.drawPoints;
                if (a.length !== 2) return [];
                const c = a.reduce((u, d) => d.height < u.height ? d : u, {
                    height: 1 / 0
                  }),
                  h = Math.max(...a.map(u => u.height));
                return [c, c.clone().setHeight(h)]
              }
            }).addTo(this.graphic),
            o = new Se({
              style: {
                color: "#ef8518",
                label: se(j({}, Ni), {
                  text: () => {
                    const a = +o.computedLength().toFixed(2);
                    if (a !== 0) return `${a}m`
                  }
                })
              },
              positions: () => this.drawPoints.slice(0, 2)
            }).addTo(this.graphic)
        }
      })
    }
  }
  class qo extends Ye {
    constructor(e) {
      super(ne(new.target.DefaultOptions, e))
    }
    start() {
      return this._map.drawTool.draw({
        type: "custom",
        minPointNum: 2,
        maxPointNum: 2,
        parent: this._parent,
        initGraphic() {
          const {
            parent: i = this._map
          } = this.options;
          this.graphic = i.addGraphic({
            type: "group"
          }), new Se({
            style: {
              material: {
                type: "PolylineArrow",
                color: () => {
                  if (this.drawPoints.length !== 2) return "transparent";
                  const [{
                    height: n
                  }, {
                    height: s
                  }] = this.drawPoints;
                  return n < s ? "#7cfc00" : "#b242fd"
                }
              },
              width: 10,
              clampToGround: !0
            },
            positions: () => this.drawPoints
          }).addTo(this.graphic), new Ot({
            position: () => {
              if (this.drawPoints.length === 2) return this.drawPoints[0]
            },
            style: {
              text: () => {
                if (this.drawPoints.length !== 2) return;
                const [n, s] = this.drawPoints, o = ft([n, s.clone().setHeight(n.height)]), a = s.height - n.height, c = Math.abs(a / o);
                return [`\u5E73\u8DDD: ${o.toFixed(3)}m`, `\u9AD8\u5DEE: ${a.toFixed(3)}m`, `\u5761\u5EA6: ${c.toFixed(4)}`, `\u5761\u5EA6\u89D2: ${l.Math.toDegrees(Math.atan(c)).toFixed(4)}\xB0`].join(`
`)
              },
              horizontalOrigin: "left",
              verticalOrigin: "bottom",
              fontSize: 20,
              color: "#f3f300",
              outlineWidth: 1,
              outlineColor: "#000",
              visibleDepth: !1,
              backgroundColor: "rgba(0,0,0,.4)",
              backgroundPadding: 10
            }
          }).addTo(this.graphic)
        }
      })
    }
  }
  P(qo, "DefaultOptions", {
    minPointNum: 2,
    maxPointNum: 2
  });
  const {
    abs: ri,
    cos: Xe,
    sin: Lt,
    acos: Df,
    atan2: ni,
    sqrt: lt,
    pow: Be
  } = Math;

  function si(r) {
    return r < 0 ? -Be(-r, 1 / 3) : Be(r, 1 / 3)
  }
  const Qo = Math.PI,
    Ui = 2 * Qo,
    ct = Qo / 2,
    kf = 1e-6,
    tn = Number.MAX_SAFE_INTEGER || 9007199254740991,
    rn = Number.MIN_SAFE_INTEGER || -9007199254740991,
    zf = {
      x: 0,
      y: 0,
      z: 0
    },
    F = {
      Tvalues: [-.06405689286260563, .06405689286260563, -.1911188674736163, .1911188674736163, -.3150426796961634, .3150426796961634, -.4337935076260451, .4337935076260451, -.5454214713888396, .5454214713888396, -.6480936519369755, .6480936519369755, -.7401241915785544, .7401241915785544, -.820001985973903, .820001985973903, -.8864155270044011, .8864155270044011, -.9382745520027328, .9382745520027328, -.9747285559713095, .9747285559713095, -.9951872199970213, .9951872199970213],
      Cvalues: [.12793819534675216, .12793819534675216, .1258374563468283, .1258374563468283, .12167047292780339, .12167047292780339, .1155056680537256, .1155056680537256, .10744427011596563, .10744427011596563, .09761865210411388, .09761865210411388, .08619016153195327, .08619016153195327, .0733464814110803, .0733464814110803, .05929858491543678, .05929858491543678, .04427743881741981, .04427743881741981, .028531388628933663, .028531388628933663, .0123412297999872, .0123412297999872],
      arcfn: function (r, e) {
        const i = e(r);
        let n = i.x * i.x + i.y * i.y;
        return typeof i.z != "undefined" && (n += i.z * i.z), lt(n)
      },
      compute: function (r, e, i) {
        if (r === 0) return e[0].t = 0, e[0];
        const n = e.length - 1;
        if (r === 1) return e[n].t = 1, e[n];
        const s = 1 - r;
        let o = e;
        if (n === 0) return e[0].t = r, e[0];
        if (n === 1) {
          const c = {
            x: s * o[0].x + r * o[1].x,
            y: s * o[0].y + r * o[1].y,
            t: r
          };
          return i && (c.z = s * o[0].z + r * o[1].z), c
        }
        if (n < 4) {
          let c = s * s,
            h = r * r,
            u, d, p, f = 0;
          n === 2 ? (o = [o[0], o[1], o[2], zf], u = c, d = s * r * 2, p = h) : n === 3 && (u = c * s, d = c * r * 3, p = s * h * 3, f = r * h);
          const m = {
            x: u * o[0].x + d * o[1].x + p * o[2].x + f * o[3].x,
            y: u * o[0].y + d * o[1].y + p * o[2].y + f * o[3].y,
            t: r
          };
          return i && (m.z = u * o[0].z + d * o[1].z + p * o[2].z + f * o[3].z), m
        }
        const a = JSON.parse(JSON.stringify(e));
        for (; a.length > 1;) {
          for (let c = 0; c < a.length - 1; c++) a[c] = {
            x: a[c].x + (a[c + 1].x - a[c].x) * r,
            y: a[c].y + (a[c + 1].y - a[c].y) * r
          }, typeof a[c].z != "undefined" && (a[c] = a[c].z + (a[c + 1].z - a[c].z) * r);
          a.splice(a.length - 1, 1)
        }
        return a[0].t = r, a[0]
      },
      computeWithRatios: function (r, e, i, n) {
        const s = 1 - r,
          o = i,
          a = e;
        let c = o[0],
          h = o[1],
          u = o[2],
          d = o[3],
          p;
        if (c *= s, h *= r, a.length === 2) return p = c + h, {
          x: (c * a[0].x + h * a[1].x) / p,
          y: (c * a[0].y + h * a[1].y) / p,
          z: n ? (c * a[0].z + h * a[1].z) / p : !1,
          t: r
        };
        if (c *= s, h *= 2 * s, u *= r * r, a.length === 3) return p = c + h + u, {
          x: (c * a[0].x + h * a[1].x + u * a[2].x) / p,
          y: (c * a[0].y + h * a[1].y + u * a[2].y) / p,
          z: n ? (c * a[0].z + h * a[1].z + u * a[2].z) / p : !1,
          t: r
        };
        if (c *= s, h *= 1.5 * s, u *= 3 * s, d *= r * r * r, a.length === 4) return p = c + h + u + d, {
          x: (c * a[0].x + h * a[1].x + u * a[2].x + d * a[3].x) / p,
          y: (c * a[0].y + h * a[1].y + u * a[2].y + d * a[3].y) / p,
          z: n ? (c * a[0].z + h * a[1].z + u * a[2].z + d * a[3].z) / p : !1,
          t: r
        }
      },
      derive: function (r, e) {
        const i = [];
        for (let n = r, s = n.length, o = s - 1; s > 1; s--, o--) {
          const a = [];
          for (let c = 0, h; c < o; c++) h = {
            x: o * (n[c + 1].x - n[c].x),
            y: o * (n[c + 1].y - n[c].y)
          }, e && (h.z = o * (n[c + 1].z - n[c].z)), a.push(h);
          i.push(a), n = a
        }
        return i
      },
      between: function (r, e, i) {
        return e <= r && r <= i || F.approximately(r, e) || F.approximately(r, i)
      },
      approximately: function (r, e, i) {
        return ri(r - e) <= (i || kf)
      },
      length: function (r) {
        const e = .5,
          i = F.Tvalues.length;
        let n = 0;
        for (let s = 0, o; s < i; s++) o = e * F.Tvalues[s] + e, n += F.Cvalues[s] * F.arcfn(o, r);
        return e * n
      },
      map: function (r, e, i, n, s) {
        const o = i - e,
          a = s - n,
          c = r - e,
          h = c / o;
        return n + a * h
      },
      lerp: function (r, e, i) {
        const n = {
          x: e.x + r * (i.x - e.x),
          y: e.y + r * (i.y - e.y)
        };
        return e.z !== void 0 && i.z !== void 0 && (n.z = e.z + r * (i.z - e.z)), n
      },
      pointToString: function (r) {
        let e = r.x + "/" + r.y;
        return typeof r.z != "undefined" && (e += "/" + r.z), e
      },
      pointsToString: function (r) {
        return "[" + r.map(F.pointToString).join(", ") + "]"
      },
      copy: function (r) {
        return JSON.parse(JSON.stringify(r))
      },
      angle: function (r, e, i) {
        const n = e.x - r.x,
          s = e.y - r.y,
          o = i.x - r.x,
          a = i.y - r.y,
          c = n * a - s * o,
          h = n * o + s * a;
        return ni(c, h)
      },
      round: function (r, e) {
        const i = "" + r,
          n = i.indexOf(".");
        return parseFloat(i.substring(0, n + 1 + e))
      },
      dist: function (r, e) {
        const i = r.x - e.x,
          n = r.y - e.y;
        return lt(i * i + n * n)
      },
      closest: function (r, e) {
        let i = Be(2, 63),
          n, s;
        return r.forEach(function (o, a) {
          s = F.dist(e, o), s < i && (i = s, n = a)
        }), {
          mdist: i,
          mpos: n
        }
      },
      abcratio: function (r, e) {
        if (e !== 2 && e !== 3) return !1;
        if (typeof r == "undefined") r = .5;
        else if (r === 0 || r === 1) return r;
        const i = Be(r, e) + Be(1 - r, e),
          n = i - 1;
        return ri(n / i)
      },
      projectionratio: function (r, e) {
        if (e !== 2 && e !== 3) return !1;
        if (typeof r == "undefined") r = .5;
        else if (r === 0 || r === 1) return r;
        const i = Be(1 - r, e),
          n = Be(r, e) + i;
        return i / n
      },
      lli8: function (r, e, i, n, s, o, a, c) {
        const h = (r * n - e * i) * (s - a) - (r - i) * (s * c - o * a),
          u = (r * n - e * i) * (o - c) - (e - n) * (s * c - o * a),
          d = (r - i) * (o - c) - (e - n) * (s - a);
        return d == 0 ? !1 : {
          x: h / d,
          y: u / d
        }
      },
      lli4: function (r, e, i, n) {
        const s = r.x,
          o = r.y,
          a = e.x,
          c = e.y,
          h = i.x,
          u = i.y,
          d = n.x,
          p = n.y;
        return F.lli8(s, o, a, c, h, u, d, p)
      },
      lli: function (r, e) {
        return F.lli4(r, r.c, e, e.c)
      },
      makeline: function (r, e) {
        return new ae(r.x, r.y, (r.x + e.x) / 2, (r.y + e.y) / 2, e.x, e.y)
      },
      findbbox: function (r) {
        let e = tn,
          i = tn,
          n = rn,
          s = rn;
        return r.forEach(function (o) {
          const a = o.bbox();
          e > a.x.min && (e = a.x.min), i > a.y.min && (i = a.y.min), n < a.x.max && (n = a.x.max), s < a.y.max && (s = a.y.max)
        }), {
          x: {
            min: e,
            mid: (e + n) / 2,
            max: n,
            size: n - e
          },
          y: {
            min: i,
            mid: (i + s) / 2,
            max: s,
            size: s - i
          }
        }
      },
      shapeintersections: function (r, e, i, n, s) {
        if (!F.bboxoverlap(e, n)) return [];
        const o = [],
          a = [r.startcap, r.forward, r.back, r.endcap],
          c = [i.startcap, i.forward, i.back, i.endcap];
        return a.forEach(function (h) {
          h.virtual || c.forEach(function (u) {
            if (u.virtual) return;
            const d = h.intersects(u, s);
            d.length > 0 && (d.c1 = h, d.c2 = u, d.s1 = r, d.s2 = i, o.push(d))
          })
        }), o
      },
      makeshape: function (r, e, i) {
        const n = e.points.length,
          s = r.points.length,
          o = F.makeline(e.points[n - 1], r.points[0]),
          a = F.makeline(r.points[s - 1], e.points[0]),
          c = {
            startcap: o,
            forward: r,
            back: e,
            endcap: a,
            bbox: F.findbbox([o, r, e, a])
          };
        return c.intersections = function (h) {
          return F.shapeintersections(c, c.bbox, h, h.bbox, i)
        }, c
      },
      getminmax: function (r, e, i) {
        if (!i) return {
          min: 0,
          max: 0
        };
        let n = tn,
          s = rn,
          o, a;
        i.indexOf(0) === -1 && (i = [0].concat(i)), i.indexOf(1) === -1 && i.push(1);
        for (let c = 0, h = i.length; c < h; c++) o = i[c], a = r.get(o), a[e] < n && (n = a[e]), a[e] > s && (s = a[e]);
        return {
          min: n,
          mid: (n + s) / 2,
          max: s,
          size: s - n
        }
      },
      align: function (r, e) {
        const i = e.p1.x,
          n = e.p1.y,
          s = -ni(e.p2.y - n, e.p2.x - i),
          o = function (a) {
            return {
              x: (a.x - i) * Xe(s) - (a.y - n) * Lt(s),
              y: (a.x - i) * Lt(s) + (a.y - n) * Xe(s)
            }
          };
        return r.map(o)
      },
      roots: function (r, e) {
        e = e || {
          p1: {
            x: 0,
            y: 0
          },
          p2: {
            x: 1,
            y: 0
          }
        };
        const i = r.length - 1,
          n = F.align(r, e),
          s = function (S) {
            return 0 <= S && S <= 1
          };
        if (i === 2) {
          const S = n[0].y,
            H = n[1].y,
            N = n[2].y,
            w = S - 2 * H + N;
          if (w !== 0) {
            const E = -lt(H * H - S * N),
              B = -S + H,
              T = -(E + B) / w,
              D = -(-E + B) / w;
            return [T, D].filter(s)
          } else if (H !== N && w === 0) return [(2 * H - N) / (2 * H - 2 * N)].filter(s);
          return []
        }
        const o = n[0].y,
          a = n[1].y,
          c = n[2].y,
          h = n[3].y;
        let u = -o + 3 * a - 3 * c + h,
          d = 3 * o - 6 * a + 3 * c,
          p = -3 * o + 3 * a,
          f = o;
        if (F.approximately(u, 0)) {
          if (F.approximately(d, 0)) return F.approximately(p, 0) ? [] : [-f / p].filter(s);
          const S = lt(p * p - 4 * d * f),
            H = 2 * d;
          return [(S - p) / H, (-p - S) / H].filter(s)
        }
        d /= u, p /= u, f /= u;
        const m = (3 * p - d * d) / 3,
          g = m / 3,
          y = (2 * d * d * d - 9 * d * p + 27 * f) / 27,
          x = y / 2,
          A = x * x + g * g * g;
        let _, v, b, C, M;
        if (A < 0) {
          const S = -m / 3,
            H = S * S * S,
            N = lt(H),
            w = -y / (2 * N),
            E = w < -1 ? -1 : w > 1 ? 1 : w,
            B = Df(E),
            T = si(N),
            D = 2 * T;
          return b = D * Xe(B / 3) - d / 3, C = D * Xe((B + Ui) / 3) - d / 3, M = D * Xe((B + 2 * Ui) / 3) - d / 3, [b, C, M].filter(s)
        } else {
          if (A === 0) return _ = x < 0 ? si(-x) : -si(x), b = 2 * _ - d / 3, C = -_ - d / 3, [b, C].filter(s); {
            const S = lt(A);
            return _ = si(-x + S), v = si(x + S), [_ - v - d / 3].filter(s)
          }
        }
      },
      droots: function (r) {
        if (r.length === 3) {
          const e = r[0],
            i = r[1],
            n = r[2],
            s = e - 2 * i + n;
          if (s !== 0) {
            const o = -lt(i * i - e * n),
              a = -e + i,
              c = -(o + a) / s,
              h = -(-o + a) / s;
            return [c, h]
          } else if (i !== n && s === 0) return [(2 * i - n) / (2 * (i - n))];
          return []
        }
        if (r.length === 2) {
          const e = r[0],
            i = r[1];
          return e !== i ? [e / (e - i)] : []
        }
        return []
      },
      curvature: function (r, e, i, n, s) {
        let o, a, c, h, u = 0,
          d = 0;
        const p = F.compute(r, e),
          f = F.compute(r, i),
          m = p.x * p.x + p.y * p.y;
        if (n ? (o = lt(Be(p.y * f.z - f.y * p.z, 2) + Be(p.z * f.x - f.z * p.x, 2) + Be(p.x * f.y - f.x * p.y, 2)), a = Be(m + p.z * p.z, 3 / 2)) : (o = p.x * f.y - p.y * f.x, a = Be(m, 3 / 2)), o === 0 || a === 0) return {
          k: 0,
          r: 0
        };
        if (u = o / a, d = a / o, !s) {
          const g = F.curvature(r - .001, e, i, n, !0).k,
            y = F.curvature(r + .001, e, i, n, !0).k;
          h = (y - u + (u - g)) / 2, c = (ri(y - u) + ri(u - g)) / 2
        }
        return {
          k: u,
          r: d,
          dk: h,
          adk: c
        }
      },
      inflections: function (r) {
        if (r.length < 4) return [];
        const e = F.align(r, {
            p1: r[0],
            p2: r.slice(-1)[0]
          }),
          i = e[2].x * e[1].y,
          n = e[3].x * e[1].y,
          s = e[1].x * e[2].y,
          o = e[3].x * e[2].y,
          a = 18 * (-3 * i + 2 * n + 3 * s - o),
          c = 18 * (3 * i - n - 3 * s),
          h = 18 * (s - i);
        if (F.approximately(a, 0)) {
          if (!F.approximately(c, 0)) {
            let f = -h / c;
            if (0 <= f && f <= 1) return [f]
          }
          return []
        }
        const u = 2 * a;
        if (F.approximately(u, 0)) return [];
        const d = c * c - 4 * a * h;
        if (d < 0) return [];
        const p = Math.sqrt(d);
        return [(p - c) / u, -(c + p) / u].filter(function (f) {
          return 0 <= f && f <= 1
        })
      },
      bboxoverlap: function (r, e) {
        const i = ["x", "y"],
          n = i.length;
        for (let s = 0, o, a, c, h; s < n; s++)
          if (o = i[s], a = r[o].mid, c = e[o].mid, h = (r[o].size + e[o].size) / 2, ri(a - c) >= h) return !1;
        return !0
      },
      expandbox: function (r, e) {
        e.x.min < r.x.min && (r.x.min = e.x.min), e.y.min < r.y.min && (r.y.min = e.y.min), e.z && e.z.min < r.z.min && (r.z.min = e.z.min), e.x.max > r.x.max && (r.x.max = e.x.max), e.y.max > r.y.max && (r.y.max = e.y.max), e.z && e.z.max > r.z.max && (r.z.max = e.z.max), r.x.mid = (r.x.min + r.x.max) / 2, r.y.mid = (r.y.min + r.y.max) / 2, r.z && (r.z.mid = (r.z.min + r.z.max) / 2), r.x.size = r.x.max - r.x.min, r.y.size = r.y.max - r.y.min, r.z && (r.z.size = r.z.max - r.z.min)
      },
      pairiteration: function (r, e, i) {
        const n = r.bbox(),
          s = e.bbox(),
          o = 1e5,
          a = i || .5;
        if (n.x.size + n.y.size < a && s.x.size + s.y.size < a) return [(o * (r._t1 + r._t2) / 2 | 0) / o + "/" + (o * (e._t1 + e._t2) / 2 | 0) / o];
        let c = r.split(.5),
          h = e.split(.5),
          u = [{
            left: c.left,
            right: h.left
          }, {
            left: c.left,
            right: h.right
          }, {
            left: c.right,
            right: h.right
          }, {
            left: c.right,
            right: h.left
          }];
        u = u.filter(function (p) {
          return F.bboxoverlap(p.left.bbox(), p.right.bbox())
        });
        let d = [];
        return u.length === 0 || (u.forEach(function (p) {
          d = d.concat(F.pairiteration(p.left, p.right, a))
        }), d = d.filter(function (p, f) {
          return d.indexOf(p) === f
        })), d
      },
      getccenter: function (r, e, i) {
        const n = e.x - r.x,
          s = e.y - r.y,
          o = i.x - e.x,
          a = i.y - e.y,
          c = n * Xe(ct) - s * Lt(ct),
          h = n * Lt(ct) + s * Xe(ct),
          u = o * Xe(ct) - a * Lt(ct),
          d = o * Lt(ct) + a * Xe(ct),
          p = (r.x + e.x) / 2,
          f = (r.y + e.y) / 2,
          m = (e.x + i.x) / 2,
          g = (e.y + i.y) / 2,
          y = p + c,
          x = f + h,
          A = m + u,
          _ = g + d,
          v = F.lli8(p, f, y, x, m, g, A, _),
          b = F.dist(v, r);
        let C = ni(r.y - v.y, r.x - v.x),
          M = ni(e.y - v.y, e.x - v.x),
          S = ni(i.y - v.y, i.x - v.x),
          H;
        return C < S ? ((C > M || M > S) && (C += Ui), C > S && (H = S, S = C, C = H)) : S < M && M < C ? (H = S, S = C, C = H) : S += Ui, v.s = C, v.e = S, v.r = b, v
      },
      numberSort: function (r, e) {
        return r - e
      }
    };
  class oi {
    constructor(e) {
      this.curves = [], this._3d = !1, e && (this.curves = e, this._3d = this.curves[0]._3d)
    }
    valueOf() {
      return this.toString()
    }
    toString() {
      return "[" + this.curves.map(function (e) {
        return F.pointsToString(e.points)
      }).join(", ") + "]"
    }
    addCurve(e) {
      this.curves.push(e), this._3d = this._3d || e._3d
    }
    length() {
      return this.curves.map(function (e) {
        return e.length()
      }).reduce(function (e, i) {
        return e + i
      })
    }
    curve(e) {
      return this.curves[e]
    }
    bbox() {
      const e = this.curves;
      for (var i = e[0].bbox(), n = 1; n < e.length; n++) F.expandbox(i, e[n].bbox());
      return i
    }
    offset(e) {
      const i = [];
      return this.curves.forEach(function (n) {
        i.push(...n.offset(e))
      }), new oi(i)
    }
  }
  const {
    abs: ai,
    min: Yo,
    max: Xo,
    cos: If,
    sin: Of,
    acos: Rf,
    sqrt: li
  } = Math, Bf = Math.PI;
  class ae {
    constructor(e) {
      let i = e && e.forEach ? e : Array.from(arguments).slice(),
        n = !1;
      if (typeof i[0] == "object") {
        n = i.length;
        const m = [];
        i.forEach(function (g) {
          ["x", "y", "z"].forEach(function (y) {
            typeof g[y] != "undefined" && m.push(g[y])
          })
        }), i = m
      }
      let s = !1;
      const o = i.length;
      if (n) {
        if (n > 4) {
          if (arguments.length !== 1) throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");
          s = !0
        }
      } else if (o !== 6 && o !== 8 && o !== 9 && o !== 12 && arguments.length !== 1) throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");
      const a = this._3d = !s && (o === 9 || o === 12) || e && e[0] && typeof e[0].z != "undefined",
        c = this.points = [];
      for (let m = 0, g = a ? 3 : 2; m < o; m += g) {
        var h = {
          x: i[m],
          y: i[m + 1]
        };
        a && (h.z = i[m + 2]), c.push(h)
      }
      const u = this.order = c.length - 1,
        d = this.dims = ["x", "y"];
      a && d.push("z"), this.dimlen = d.length;
      const p = F.align(c, {
          p1: c[0],
          p2: c[u]
        }),
        f = F.dist(c[0], c[u]);
      this._linear = p.reduce((m, g) => m + ai(g.y), 0) < f / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update()
    }
    static quadraticFromPoints(e, i, n, s) {
      if (typeof s == "undefined" && (s = .5), s === 0) return new ae(i, i, n);
      if (s === 1) return new ae(e, i, i);
      const o = ae.getABC(2, e, i, n, s);
      return new ae(e, o.A, n)
    }
    static cubicFromPoints(e, i, n, s, o) {
      typeof s == "undefined" && (s = .5);
      const a = ae.getABC(3, e, i, n, s);
      typeof o == "undefined" && (o = F.dist(i, a.C));
      const c = o * (1 - s) / s,
        h = F.dist(e, n),
        u = (n.x - e.x) / h,
        d = (n.y - e.y) / h,
        p = o * u,
        f = o * d,
        m = c * u,
        g = c * d,
        y = {
          x: i.x - p,
          y: i.y - f
        },
        x = {
          x: i.x + m,
          y: i.y + g
        },
        A = a.A,
        _ = {
          x: A.x + (y.x - A.x) / (1 - s),
          y: A.y + (y.y - A.y) / (1 - s)
        },
        v = {
          x: A.x + (x.x - A.x) / s,
          y: A.y + (x.y - A.y) / s
        },
        b = {
          x: e.x + (_.x - e.x) / s,
          y: e.y + (_.y - e.y) / s
        },
        C = {
          x: n.x + (v.x - n.x) / (1 - s),
          y: n.y + (v.y - n.y) / (1 - s)
        };
      return new ae(e, b, C, n)
    }
    static getUtils() {
      return F
    }
    getUtils() {
      return ae.getUtils()
    }
    static get PolyBezier() {
      return oi
    }
    valueOf() {
      return this.toString()
    }
    toString() {
      return F.pointsToString(this.points)
    }
    toSVG() {
      if (this._3d) return !1;
      const e = this.points,
        i = e[0].x,
        n = e[0].y,
        s = ["M", i, n, this.order === 2 ? "Q" : "C"];
      for (let o = 1, a = e.length; o < a; o++) s.push(e[o].x), s.push(e[o].y);
      return s.join(" ")
    }
    setRatios(e) {
      if (e.length !== this.points.length) throw new Error("incorrect number of ratio values");
      this.ratios = e, this._lut = []
    }
    verify() {
      const e = this.coordDigest();
      e !== this._print && (this._print = e, this.update())
    }
    coordDigest() {
      return this.points.map(function (e, i) {
        return "" + i + e.x + e.y + (e.z ? e.z : 0)
      }).join("")
    }
    update() {
      this._lut = [], this.dpoints = F.derive(this.points, this._3d), this.computedirection()
    }
    computedirection() {
      const e = this.points,
        i = F.angle(e[0], e[this.order], e[1]);
      this.clockwise = i > 0
    }
    length() {
      return F.length(this.derivative.bind(this))
    }
    static getABC(e = 2, i, n, s, o = .5) {
      const a = F.projectionratio(o, e),
        c = 1 - a,
        h = {
          x: a * i.x + c * s.x,
          y: a * i.y + c * s.y
        },
        u = F.abcratio(o, e);
      return {
        A: {
          x: n.x + (n.x - h.x) / u,
          y: n.y + (n.y - h.y) / u
        },
        B: n,
        C: h,
        S: i,
        E: s
      }
    }
    getABC(e, i) {
      i = i || this.get(e);
      let n = this.points[0],
        s = this.points[this.order];
      return ae.getABC(this.order, n, i, s, e)
    }
    getLUT(e) {
      if (this.verify(), e = e || 100, this._lut.length === e + 1) return this._lut;
      this._lut = [], e++, this._lut = [];
      for (let i = 0, n, s; i < e; i++) s = i / (e - 1), n = this.compute(s), n.t = s, this._lut.push(n);
      return this._lut
    }
    on(e, i) {
      i = i || 5;
      const n = this.getLUT(),
        s = [];
      for (let o = 0, a, c = 0; o < n.length; o++) a = n[o], F.dist(a, e) < i && (s.push(a), c += o / n.length);
      return s.length ? t /= s.length : !1
    }
    project(e) {
      const i = this.getLUT(),
        n = i.length - 1,
        s = F.closest(i, e),
        o = s.mpos,
        a = (o - 1) / n,
        c = (o + 1) / n,
        h = .1 / n;
      let u = s.mdist,
        d = a,
        p = d,
        f;
      u += 1;
      for (let m; d < c + h; d += h) f = this.compute(d), m = F.dist(e, f), m < u && (u = m, p = d);
      return p = p < 0 ? 0 : p > 1 ? 1 : p, f = this.compute(p), f.t = p, f.d = u, f
    }
    get(e) {
      return this.compute(e)
    }
    point(e) {
      return this.points[e]
    }
    compute(e) {
      return this.ratios ? F.computeWithRatios(e, this.points, this.ratios, this._3d) : F.compute(e, this.points, this._3d, this.ratios)
    }
    raise() {
      const e = this.points,
        i = [e[0]],
        n = e.length;
      for (let s = 1, o, a; s < n; s++) o = e[s], a = e[s - 1], i[s] = {
        x: (n - s) / n * o.x + s / n * a.x,
        y: (n - s) / n * o.y + s / n * a.y
      };
      return i[n] = e[n - 1], new ae(i)
    }
    derivative(e) {
      return F.compute(e, this.dpoints[0], this._3d)
    }
    dderivative(e) {
      return F.compute(e, this.dpoints[1], this._3d)
    }
    align() {
      let e = this.points;
      return new ae(F.align(e, {
        p1: e[0],
        p2: e[e.length - 1]
      }))
    }
    curvature(e) {
      return F.curvature(e, this.dpoints[0], this.dpoints[1], this._3d)
    }
    inflections() {
      return F.inflections(this.points)
    }
    normal(e) {
      return this._3d ? this.__normal3(e) : this.__normal2(e)
    }
    __normal2(e) {
      const i = this.derivative(e),
        n = li(i.x * i.x + i.y * i.y);
      return {
        t: e,
        x: -i.y / n,
        y: i.x / n
      }
    }
    __normal3(e) {
      const i = this.derivative(e),
        n = this.derivative(e + .01),
        s = li(i.x * i.x + i.y * i.y + i.z * i.z),
        o = li(n.x * n.x + n.y * n.y + n.z * n.z);
      i.x /= s, i.y /= s, i.z /= s, n.x /= o, n.y /= o, n.z /= o;
      const a = {
          x: n.y * i.z - n.z * i.y,
          y: n.z * i.x - n.x * i.z,
          z: n.x * i.y - n.y * i.x
        },
        c = li(a.x * a.x + a.y * a.y + a.z * a.z);
      a.x /= c, a.y /= c, a.z /= c;
      const h = [a.x * a.x, a.x * a.y - a.z, a.x * a.z + a.y, a.x * a.y + a.z, a.y * a.y, a.y * a.z - a.x, a.x * a.z - a.y, a.y * a.z + a.x, a.z * a.z];
      return {
        t: e,
        x: h[0] * i.x + h[1] * i.y + h[2] * i.z,
        y: h[3] * i.x + h[4] * i.y + h[5] * i.z,
        z: h[6] * i.x + h[7] * i.y + h[8] * i.z
      }
    }
    hull(e) {
      let i = this.points,
        n = [],
        s = [],
        o = 0;
      for (s[o++] = i[0], s[o++] = i[1], s[o++] = i[2], this.order === 3 && (s[o++] = i[3]); i.length > 1;) {
        n = [];
        for (let a = 0, c, h = i.length - 1; a < h; a++) c = F.lerp(e, i[a], i[a + 1]), s[o++] = c, n.push(c);
        i = n
      }
      return s
    }
    split(e, i) {
      if (e === 0 && !!i) return this.split(i).left;
      if (i === 1) return this.split(e).right;
      const n = this.hull(e),
        s = {
          left: this.order === 2 ? new ae([n[0], n[3], n[5]]) : new ae([n[0], n[4], n[7], n[9]]),
          right: this.order === 2 ? new ae([n[5], n[4], n[2]]) : new ae([n[9], n[8], n[6], n[3]]),
          span: n
        };
      return s.left._t1 = F.map(0, 0, 1, this._t1, this._t2), s.left._t2 = F.map(e, 0, 1, this._t1, this._t2), s.right._t1 = F.map(e, 0, 1, this._t1, this._t2), s.right._t2 = F.map(1, 0, 1, this._t1, this._t2), i ? (i = F.map(i, e, 1, 0, 1), s.right.split(i).left) : s
    }
    extrema() {
      const e = {};
      let i = [];
      return this.dims.forEach(function (n) {
        let s = function (a) {
            return a[n]
          },
          o = this.dpoints[0].map(s);
        e[n] = F.droots(o), this.order === 3 && (o = this.dpoints[1].map(s), e[n] = e[n].concat(F.droots(o))), e[n] = e[n].filter(function (a) {
          return a >= 0 && a <= 1
        }), i = i.concat(e[n].sort(F.numberSort))
      }.bind(this)), e.values = i.sort(F.numberSort).filter(function (n, s) {
        return i.indexOf(n) === s
      }), e
    }
    bbox() {
      const e = this.extrema(),
        i = {};
      return this.dims.forEach(function (n) {
        i[n] = F.getminmax(this, n, e[n])
      }.bind(this)), i
    }
    overlaps(e) {
      const i = this.bbox(),
        n = e.bbox();
      return F.bboxoverlap(i, n)
    }
    offset(e, i) {
      if (typeof i != "undefined") {
        const n = this.get(e),
          s = this.normal(e),
          o = {
            c: n,
            n: s,
            x: n.x + s.x * i,
            y: n.y + s.y * i
          };
        return this._3d && (o.z = n.z + s.z * i), o
      }
      if (this._linear) {
        const n = this.normal(0),
          s = this.points.map(function (o) {
            const a = {
              x: o.x + e * n.x,
              y: o.y + e * n.y
            };
            return o.z && n.z && (a.z = o.z + e * n.z), a
          });
        return [new ae(s)]
      }
      return this.reduce().map(function (n) {
        return n._linear ? n.offset(e)[0] : n.scale(e)
      })
    }
    simple() {
      if (this.order === 3) {
        const s = F.angle(this.points[0], this.points[3], this.points[1]),
          o = F.angle(this.points[0], this.points[3], this.points[2]);
        if (s > 0 && o < 0 || s < 0 && o > 0) return !1
      }
      const e = this.normal(0),
        i = this.normal(1);
      let n = e.x * i.x + e.y * i.y;
      return this._3d && (n += e.z * i.z), ai(Rf(n)) < Bf / 3
    }
    reduce() {
      let e, i = 0,
        n = 0,
        s = .01,
        o, a = [],
        c = [],
        h = this.extrema().values;
      for (h.indexOf(0) === -1 && (h = [0].concat(h)), h.indexOf(1) === -1 && h.push(1), i = h[0], e = 1; e < h.length; e++) n = h[e], o = this.split(i, n), o._t1 = i, o._t2 = n, a.push(o), i = n;
      return a.forEach(function (u) {
        for (i = 0, n = 0; n <= 1;)
          for (n = i + s; n <= 1 + s; n += s)
            if (o = u.split(i, n), !o.simple()) {
              if (n -= s, ai(i - n) < s) return [];
              o = u.split(i, n), o._t1 = F.map(i, 0, 1, u._t1, u._t2), o._t2 = F.map(n, 0, 1, u._t1, u._t2), c.push(o), i = n;
              break
            } i < 1 && (o = u.split(i, 1), o._t1 = F.map(i, 0, 1, u._t1, u._t2), o._t2 = u._t2, c.push(o))
      }), c
    }
    translate(e, i, n) {
      n = typeof n == "number" ? n : i;
      const s = this.order;
      let o = this.points.map((a, c) => (1 - c / s) * i + c / s * n);
      return new ae(this.points.map((a, c) => ({
        x: a.x + e.x * o[c],
        y: a.y + e.y * o[c]
      })))
    }
    scale(e) {
      const i = this.order;
      let n = !1;
      if (typeof e == "function" && (n = e), n && i === 2) return this.raise().scale(n);
      const s = this.clockwise,
        o = this.points;
      if (this._linear) return this.translate(this.normal(0), n ? n(0) : e, n ? n(1) : e);
      const a = n ? n(0) : e,
        c = n ? n(1) : e,
        h = [this.offset(0, 10), this.offset(1, 10)],
        u = [],
        d = F.lli4(h[0], h[0].c, h[1], h[1].c);
      if (!d) throw new Error("cannot scale this curve. Try reducing it first.");
      return [0, 1].forEach(function (p) {
        const f = u[p * i] = F.copy(o[p * i]);
        f.x += (p ? c : a) * h[p].n.x, f.y += (p ? c : a) * h[p].n.y
      }), n ? ([0, 1].forEach(function (p) {
        if (!(i === 2 && !!p)) {
          var f = o[p + 1],
            m = {
              x: f.x - d.x,
              y: f.y - d.y
            },
            g = n ? n((p + 1) / i) : e;
          n && !s && (g = -g);
          var y = li(m.x * m.x + m.y * m.y);
          m.x /= y, m.y /= y, u[p + 1] = {
            x: f.x + g * m.x,
            y: f.y + g * m.y
          }
        }
      }), new ae(u)) : ([0, 1].forEach(p => {
        if (i === 2 && !!p) return;
        const f = u[p * i],
          m = this.derivative(p),
          g = {
            x: f.x + m.x,
            y: f.y + m.y
          };
        u[p + 1] = F.lli4(f, g, d, o[p + 1])
      }), new ae(u))
    }
    outline(e, i, n, s) {
      if (i = i === void 0 ? e : i, this._linear) {
        const C = this.normal(0),
          M = this.points[0],
          S = this.points[this.points.length - 1];
        let H, N, w;
        n === void 0 && (n = e, s = i), H = {
          x: M.x + C.x * e,
          y: M.y + C.y * e
        }, w = {
          x: S.x + C.x * n,
          y: S.y + C.y * n
        }, N = {
          x: (H.x + w.x) / 2,
          y: (H.y + w.y) / 2
        };
        const E = [H, N, w];
        H = {
          x: M.x - C.x * i,
          y: M.y - C.y * i
        }, w = {
          x: S.x - C.x * s,
          y: S.y - C.y * s
        }, N = {
          x: (H.x + w.x) / 2,
          y: (H.y + w.y) / 2
        };
        const B = [w, N, H],
          T = F.makeline(B[2], E[0]),
          D = F.makeline(E[2], B[0]),
          k = [T, new ae(E), D, new ae(B)];
        return new oi(k)
      }
      const o = this.reduce(),
        a = o.length,
        c = [];
      let h = [],
        u, d = 0,
        p = this.length();
      const f = typeof n != "undefined" && typeof s != "undefined";

      function m(C, M, S, H, N) {
        return function (w) {
          const E = H / S,
            B = (H + N) / S,
            T = M - C;
          return F.map(w, 0, 1, C + E * T, C + B * T)
        }
      }
      o.forEach(function (C) {
        const M = C.length();
        f ? (c.push(C.scale(m(e, n, p, d, M))), h.push(C.scale(m(-i, -s, p, d, M)))) : (c.push(C.scale(e)), h.push(C.scale(-i))), d += M
      }), h = h.map(function (C) {
        return u = C.points, u[3] ? C.points = [u[3], u[2], u[1], u[0]] : C.points = [u[2], u[1], u[0]], C
      }).reverse();
      const g = c[0].points[0],
        y = c[a - 1].points[c[a - 1].points.length - 1],
        x = h[a - 1].points[h[a - 1].points.length - 1],
        A = h[0].points[0],
        _ = F.makeline(x, g),
        v = F.makeline(y, A),
        b = [_].concat(c).concat([v]).concat(h);
      return new oi(b)
    }
    outlineshapes(e, i, n) {
      i = i || e;
      const s = this.outline(e, i).curves,
        o = [];
      for (let a = 1, c = s.length; a < c / 2; a++) {
        const h = F.makeshape(s[a], s[c - a], n);
        h.startcap.virtual = a > 1, h.endcap.virtual = a < c / 2 - 1, o.push(h)
      }
      return o
    }
    intersects(e, i) {
      return e ? e.p1 && e.p2 ? this.lineIntersects(e) : (e instanceof ae && (e = e.reduce()), this.curveintersects(this.reduce(), e, i)) : this.selfintersects(i)
    }
    lineIntersects(e) {
      const i = Yo(e.p1.x, e.p2.x),
        n = Yo(e.p1.y, e.p2.y),
        s = Xo(e.p1.x, e.p2.x),
        o = Xo(e.p1.y, e.p2.y);
      return F.roots(this.points, e).filter(a => {
        var c = this.get(a);
        return F.between(c.x, i, s) && F.between(c.y, n, o)
      })
    }
    selfintersects(e) {
      const i = this.reduce(),
        n = i.length - 2,
        s = [];
      for (let o = 0, a, c, h; o < n; o++) c = i.slice(o, o + 1), h = i.slice(o + 2), a = this.curveintersects(c, h, e), s.push(...a);
      return s
    }
    curveintersects(e, i, n) {
      const s = [];
      e.forEach(function (a) {
        i.forEach(function (c) {
          a.overlaps(c) && s.push({
            left: a,
            right: c
          })
        })
      });
      let o = [];
      return s.forEach(function (a) {
        const c = F.pairiteration(a.left, a.right, n);
        c.length > 0 && (o = o.concat(c))
      }), o
    }
    arcs(e) {
      return e = e || .5, this._iterate(e, [])
    }
    _error(e, i, n, s) {
      const o = (s - n) / 4,
        a = this.get(n + o),
        c = this.get(s - o),
        h = F.dist(e, i),
        u = F.dist(e, a),
        d = F.dist(e, c);
      return ai(u - h) + ai(d - h)
    }
    _iterate(e, i) {
      let n = 0,
        s = 1,
        o;
      do {
        o = 0, s = 1;
        let a = this.get(n),
          c, h, u, d, p = !1,
          f = !1,
          m, g = s,
          y = 1;
        do
          if (f = p, d = u, g = (n + s) / 2, c = this.get(g), h = this.get(s), u = F.getccenter(a, c, h), u.interval = {
              start: n,
              end: s
            }, p = this._error(u, a, n, s) <= e, m = f && !p, m || (y = s), p) {
            if (s >= 1) {
              if (u.interval.end = y = 1, d = u, s > 1) {
                let A = {
                  x: u.x + u.r * If(u.e),
                  y: u.y + u.r * Of(u.e)
                };
                u.e += F.angle({
                  x: u.x,
                  y: u.y
                }, A, this.get(1))
              }
              break
            }
            s = s + (s - n) / 2
          } else s = g; while (!m && o++ < 100);
        if (o >= 100) break;
        d = d || u, i.push(d), n = y
      } while (s < 1);
      return i
    }
  }
  class Lf extends Ye {
    start({
      callback: e
    } = {}) {
      return this._map.drawTool.draw({
        type: "custom",
        minPointNum: 2,
        maxPointNum: 1 / 0,
        parent: this._parent,
        initGraphic() {
          const {
            parent: n = this._map
          } = this.options;
          this.graphic = n.addGraphic({
            type: "group"
          });
          const s = new Se({
            style: {
              width: 8,
              material: {
                type: "PolylineArrow",
                color: "rgb(42, 174, 254)"
              },
              clampToGround: !0
            },
            positions: () => {
              if (this.drawPoints.length < 2) return;
              const o = this.drawPoints.map(h => {
                  const {
                    x: u,
                    y: d
                  } = h.toMercator();
                  return {
                    x: u,
                    y: d
                  }
                }),
                a = new ae(o),
                c = [];
              for (let h = 0; h <= 1; h += .01) {
                let u = a.get(h);
                c.push(R.fromMercator(u))
              }
              return c
            }
          }).addTo(this.graphic);
          this.once("drawEnd", () => {
            let o = n.addGraphic({
              type: "divPoint",
              style: {}
            });
            s.on("mousemove", a => {
              const c = a.point,
                h = new ae(this.drawPoints.map(d => {
                  const {
                    x: p,
                    y: f
                  } = d.toMercator();
                  return {
                    x: p,
                    y: f
                  }
                })),
                {
                  t: u
                } = h.project(c.toMercator());
              if (u >= 0 && u <= 1) {
                const d = h.curvature(u),
                  p = +d.r.toFixed(3),
                  f = +d.k.toFixed(8);
                e == null || e({
                  point: c,
                  curvatureRadius: p,
                  curvature: f
                });
                const {
                  lat: m,
                  lng: g,
                  alt: y
                } = c.toLatLng();
                o.setOptions({
                  position: c,
                  style: {
                    html: `
                                <div class="cesium-curvature-htmlpoint-wrapper">
                                  <div class="text">
                                    <div>
                                        <span>\u7ECF\u5EA6\uFF1A</span>
                                        <span>${+g.toFixed(8)}</span>
                                    </div>
                                    <div>
                                        <span>\u7EAC\u5EA6\uFF1A</span>
                                        <span>${+m.toFixed(8)}</span>
                                    </div>
                                    <div>
                                        <span>\u9AD8\u7A0B\uFF1A</span>
                                        <span>${+y.toFixed(3)}</span>
                                    </div>
                                    <div>
                                        <span>\u66F2\u7387\uFF1A</span>
                                        <span>${Math.abs(f)}</span>
                                    </div>
                                    <div>
                                        <span>\u66F2\u7387\u534A\u5F84\uFF1A</span>
                                        <span>${Math.abs(p)}</span>
                                    </div>
                                  </div>
                                  <div class="refer-line"> </div>
                                  <div class="circle"></div>
                                </div>
                            `
                  }
                })
              }
            })
          })
        }
      })
    }
  }
  class Ko {
    constructor({
      map: e
    }) {
      P(this, "instances", []);
      P(this, "isDestroyed", !1);
      this._map = e
    }
    distance(e) {
      return this.currentMeasure = new Af({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    horizontalDistance(e) {
      return this.currentMeasure = new Vo({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    verticalDistance(e) {
      return this.currentMeasure = new jo({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    triangleDistance(e) {
      return this.currentMeasure = new Ef({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    curvatureAnalysis(e) {
      return this.currentMeasure = new Lf({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    slope(e) {
      return this.currentMeasure = new qo({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    height(e) {
      return this.currentMeasure = new Pf({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    area(e) {
      return this.currentMeasure = new Sf({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    angle(e) {
      return this.currentMeasure = new Mf({
        map: this._map
      }), this.instances.push(this.currentMeasure), this.currentMeasure.start(e)
    }
    clear() {
      this.finish(), this.instances.forEach(e => {
        e.destroy()
      }), this.instances = []
    }
    finish() {
      this.currentMeasure && (this.currentMeasure.finish(), this.currentMeasure = null)
    }
    destroy() {
      this.isDestroyed || (this.currentMeasure = null, this.instances.forEach(e => {
        e.destroy()
      }), this.instances = null, this._map = null, this.isDestroyed = !0)
    }
  }
  class Gf {
    constructor({
      map: e
    }) {
      this._map = e
    }
    start(o = {}, s = c => c) {
      var a = o,
        {
          style: e = {},
          keep: i = !1
        } = a,
        n = re(a, ["style", "keep"]);
      return new Promise(async c => {
        const h = this._map,
          {
            target: u
          } = await h.drawTool.draw(j({
            type: "circle",
            style: j({
              clampToGround: !0
            }, e)
          }, n));
        c(h.getAllGraphics().filter(d => d.point && d.point.isInCircle(u) && s(d) && d.visible && d !== u)), i ? this._graphic = u : u.destroy()
      })
    }
    finish() {
      this._map.drawTool.finish()
    }
    destroy() {
      this.isDestroyed || (this.isDestroyed = !0, this._graphic && (this._graphic.destroy(), this._graphic = null), this.finish(), this._map = null)
    }
  }
  class Ff {
    constructor({
      map: e
    }) {
      this._map = e
    }
    start(o = {}, s = c => c) {
      var a = o,
        {
          style: e = {},
          keep: i = !1
        } = a,
        n = re(a, ["style", "keep"]);
      return new Promise(async c => {
        const h = this._map,
          {
            target: u
          } = await h.drawTool.draw(j({
            type: "rectangle",
            style: j({
              clampToGround: !0
            }, e)
          }, n));
        c(h.getAllGraphics().filter(d => d.point && d.point.isInPolygon(u.boundingPoints) && s(d) && d.visible && d !== u)), i ? this._graphic = u : u.destroy()
      })
    }
    finish() {
      this._map.drawTool.finish()
    }
    destroy() {
      this.isDestroyed || (this.isDestroyed = !0, this._graphic && (this._graphic.destroy(), this._graphic = null), this.finish(), this._map = null)
    }
  }
  class Hf {
    constructor({
      map: e
    }) {
      this._map = e
    }
    start(o = {}, s = c => c) {
      var a = o,
        {
          style: e = {},
          keep: i = !1
        } = a,
        n = re(a, ["style", "keep"]);
      return new Promise(async c => {
        const h = this._map,
          {
            target: u
          } = await h.drawTool.draw(j({
            type: "polygon",
            style: j({
              clampToGround: !0
            }, e)
          }, n));
        c(h.getAllGraphics().filter(d => d.point && d.point.isInPolygon(u) && s(d) && d.visible && d !== u)), i ? this._graphic = u : u.destroy()
      })
    }
    finish() {
      this._map.drawTool.finish()
    }
    destroy() {
      this.isDestroyed || (this.isDestroyed = !0, this._graphic && (this._graphic.destroy(), this._graphic = null), this.finish(), this._map = null)
    }
  }
  class Jo {
    constructor({
      map: e
    }) {
      P(this, "instances", []);
      P(this, "currentPicker", null);
      P(this, "isDestroyed", !1);
      this._map = e
    }
    circle(e) {
      return this.finish(), this.currentPicker = new Gf({
        map: this._map
      }), this.instances.push(this.currentPicker), this.currentPicker.start(e)
    }
    rectangle(e) {
      return this.finish(), this.currentPicker = new Ff({
        map: this._map
      }), this.instances.push(this.currentPicker), this.currentPicker.start(e)
    }
    polygon(e) {
      return this.finish(), this.currentPicker = new Hf({
        map: this._map
      }), this.instances.push(this.currentPicker), this.currentPicker.start(e)
    }
    async view({
      match: e = () => !0
    } = {}) {
      const i = this._map,
        n = i.viewer.camera.computeViewRectangle(),
        s = [l.Rectangle.southeast(n), l.Rectangle.northeast(n), l.Rectangle.northwest(n), l.Rectangle.southwest(n)];
      return i.getAllGraphics().filter(o => o.point && o.point.isInPolygon(s) && e(o) && o.visible)
    }
    finish() {
      this.currentPicker && (this.currentPicker.finish(), this.currentPicker = null)
    }
    clear() {
      this.finish(), this.instances.forEach(e => {
        e.destroy()
      }), this.instances = []
    }
    destroy() {
      this.isDestroyed || (this._map = null, this.isDestroyed = !0)
    }
  }
  class Gt extends it {
    constructor(e) {
      super();
      this.id = e.id || Kt(), this.options = e
    }
    addTo(e) {
      return e.addControl(this), this
    }
  }
  var $o = {
      exports: {}
    },
    Ve = {
      exports: {}
    };
  (function (r, e) {
    (function (i, n) {
      r.exports = n()
    })(ve, function () {
      var i = i || function (n, s) {
        var o;
        if (typeof window != "undefined" && window.crypto && (o = window.crypto), typeof self != "undefined" && self.crypto && (o = self.crypto), typeof globalThis != "undefined" && globalThis.crypto && (o = globalThis.crypto), !o && typeof window != "undefined" && window.msCrypto && (o = window.msCrypto), !o && typeof ve != "undefined" && ve.crypto && (o = ve.crypto), !o && typeof Sh == "function") try {
          o = require("crypto")
        } catch {}
        var a = function () {
            if (o) {
              if (typeof o.getRandomValues == "function") try {
                return o.getRandomValues(new Uint32Array(1))[0]
              } catch {}
              if (typeof o.randomBytes == "function") try {
                return o.randomBytes(4).readInt32LE()
              } catch {}
            }
            throw new Error("Native crypto module could not be used to get secure random number.")
          },
          c = Object.create || function () {
            function _() {}
            return function (v) {
              var b;
              return _.prototype = v, b = new _, _.prototype = null, b
            }
          }(),
          h = {},
          u = h.lib = {},
          d = u.Base = function () {
            return {
              extend: function (_) {
                var v = c(this);
                return _ && v.mixIn(_), (!v.hasOwnProperty("init") || this.init === v.init) && (v.init = function () {
                  v.$super.init.apply(this, arguments)
                }), v.init.prototype = v, v.$super = this, v
              },
              create: function () {
                var _ = this.extend();
                return _.init.apply(_, arguments), _
              },
              init: function () {},
              mixIn: function (_) {
                for (var v in _) _.hasOwnProperty(v) && (this[v] = _[v]);
                _.hasOwnProperty("toString") && (this.toString = _.toString)
              },
              clone: function () {
                return this.init.prototype.extend(this)
              }
            }
          }(),
          p = u.WordArray = d.extend({
            init: function (_, v) {
              _ = this.words = _ || [], v != s ? this.sigBytes = v : this.sigBytes = _.length * 4
            },
            toString: function (_) {
              return (_ || m).stringify(this)
            },
            concat: function (_) {
              var v = this.words,
                b = _.words,
                C = this.sigBytes,
                M = _.sigBytes;
              if (this.clamp(), C % 4)
                for (var S = 0; S < M; S++) {
                  var H = b[S >>> 2] >>> 24 - S % 4 * 8 & 255;
                  v[C + S >>> 2] |= H << 24 - (C + S) % 4 * 8
                } else
                  for (var N = 0; N < M; N += 4) v[C + N >>> 2] = b[N >>> 2];
              return this.sigBytes += M, this
            },
            clamp: function () {
              var _ = this.words,
                v = this.sigBytes;
              _[v >>> 2] &= 4294967295 << 32 - v % 4 * 8, _.length = n.ceil(v / 4)
            },
            clone: function () {
              var _ = d.clone.call(this);
              return _.words = this.words.slice(0), _
            },
            random: function (_) {
              for (var v = [], b = 0; b < _; b += 4) v.push(a());
              return new p.init(v, _)
            }
          }),
          f = h.enc = {},
          m = f.Hex = {
            stringify: function (_) {
              for (var v = _.words, b = _.sigBytes, C = [], M = 0; M < b; M++) {
                var S = v[M >>> 2] >>> 24 - M % 4 * 8 & 255;
                C.push((S >>> 4).toString(16)), C.push((S & 15).toString(16))
              }
              return C.join("")
            },
            parse: function (_) {
              for (var v = _.length, b = [], C = 0; C < v; C += 2) b[C >>> 3] |= parseInt(_.substr(C, 2), 16) << 24 - C % 8 * 4;
              return new p.init(b, v / 2)
            }
          },
          g = f.Latin1 = {
            stringify: function (_) {
              for (var v = _.words, b = _.sigBytes, C = [], M = 0; M < b; M++) {
                var S = v[M >>> 2] >>> 24 - M % 4 * 8 & 255;
                C.push(String.fromCharCode(S))
              }
              return C.join("")
            },
            parse: function (_) {
              for (var v = _.length, b = [], C = 0; C < v; C++) b[C >>> 2] |= (_.charCodeAt(C) & 255) << 24 - C % 4 * 8;
              return new p.init(b, v)
            }
          },
          y = f.Utf8 = {
            stringify: function (_) {
              try {
                return decodeURIComponent(escape(g.stringify(_)))
              } catch {
                throw new Error("Malformed UTF-8 data")
              }
            },
            parse: function (_) {
              return g.parse(unescape(encodeURIComponent(_)))
            }
          },
          x = u.BufferedBlockAlgorithm = d.extend({
            reset: function () {
              this._data = new p.init, this._nDataBytes = 0
            },
            _append: function (_) {
              typeof _ == "string" && (_ = y.parse(_)), this._data.concat(_), this._nDataBytes += _.sigBytes
            },
            _process: function (_) {
              var v, b = this._data,
                C = b.words,
                M = b.sigBytes,
                S = this.blockSize,
                H = S * 4,
                N = M / H;
              _ ? N = n.ceil(N) : N = n.max((N | 0) - this._minBufferSize, 0);
              var w = N * S,
                E = n.min(w * 4, M);
              if (w) {
                for (var B = 0; B < w; B += S) this._doProcessBlock(C, B);
                v = C.splice(0, w), b.sigBytes -= E
              }
              return new p.init(v, E)
            },
            clone: function () {
              var _ = d.clone.call(this);
              return _._data = this._data.clone(), _
            },
            _minBufferSize: 0
          });
        u.Hasher = x.extend({
          cfg: d.extend(),
          init: function (_) {
            this.cfg = this.cfg.extend(_), this.reset()
          },
          reset: function () {
            x.reset.call(this), this._doReset()
          },
          update: function (_) {
            return this._append(_), this._process(), this
          },
          finalize: function (_) {
            _ && this._append(_);
            var v = this._doFinalize();
            return v
          },
          blockSize: 512 / 32,
          _createHelper: function (_) {
            return function (v, b) {
              return new _.init(b).finalize(v)
            }
          },
          _createHmacHelper: function (_) {
            return function (v, b) {
              return new A.HMAC.init(_, b).finalize(v)
            }
          }
        });
        var A = h.algo = {};
        return h
      }(Math);
      return i
    })
  })(Ve),
  function (r, e) {
    (function (i, n) {
      r.exports = n(Ve.exports)
    })(ve, function (i) {
      return i.enc.Utf8
    })
  }($o);
  var Vi = $o.exports,
    Zo = {
      exports: {}
    },
    ea = {
      exports: {}
    };
  (function (r, e) {
    (function (i, n) {
      r.exports = n(Ve.exports)
    })(ve, function (i) {
      return function () {
        var n = i,
          s = n.lib,
          o = s.WordArray,
          a = n.enc;
        a.Base64 = {
          stringify: function (h) {
            var u = h.words,
              d = h.sigBytes,
              p = this._map;
            h.clamp();
            for (var f = [], m = 0; m < d; m += 3)
              for (var g = u[m >>> 2] >>> 24 - m % 4 * 8 & 255, y = u[m + 1 >>> 2] >>> 24 - (m + 1) % 4 * 8 & 255, x = u[m + 2 >>> 2] >>> 24 - (m + 2) % 4 * 8 & 255, A = g << 16 | y << 8 | x, _ = 0; _ < 4 && m + _ * .75 < d; _++) f.push(p.charAt(A >>> 6 * (3 - _) & 63));
            var v = p.charAt(64);
            if (v)
              for (; f.length % 4;) f.push(v);
            return f.join("")
          },
          parse: function (h) {
            var u = h.length,
              d = this._map,
              p = this._reverseMap;
            if (!p) {
              p = this._reverseMap = [];
              for (var f = 0; f < d.length; f++) p[d.charCodeAt(f)] = f
            }
            var m = d.charAt(64);
            if (m) {
              var g = h.indexOf(m);
              g !== -1 && (u = g)
            }
            return c(h, u, p)
          },
          _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
        };

        function c(h, u, d) {
          for (var p = [], f = 0, m = 0; m < u; m++)
            if (m % 4) {
              var g = d[h.charCodeAt(m - 1)] << m % 4 * 2,
                y = d[h.charCodeAt(m)] >>> 6 - m % 4 * 2,
                x = g | y;
              p[f >>> 2] |= x << 24 - f % 4 * 8, f++
            } return o.create(p, f)
        }
      }(), i.enc.Base64
    })
  })(ea);
  var ta = {
    exports: {}
  };
  (function (r, e) {
    (function (i, n) {
      r.exports = n(Ve.exports)
    })(ve, function (i) {
      return function (n) {
        var s = i,
          o = s.lib,
          a = o.WordArray,
          c = o.Hasher,
          h = s.algo,
          u = [];
        (function () {
          for (var y = 0; y < 64; y++) u[y] = n.abs(n.sin(y + 1)) * 4294967296 | 0
        })();
        var d = h.MD5 = c.extend({
          _doReset: function () {
            this._hash = new a.init([1732584193, 4023233417, 2562383102, 271733878])
          },
          _doProcessBlock: function (y, x) {
            for (var A = 0; A < 16; A++) {
              var _ = x + A,
                v = y[_];
              y[_] = (v << 8 | v >>> 24) & 16711935 | (v << 24 | v >>> 8) & 4278255360
            }
            var b = this._hash.words,
              C = y[x + 0],
              M = y[x + 1],
              S = y[x + 2],
              H = y[x + 3],
              N = y[x + 4],
              w = y[x + 5],
              E = y[x + 6],
              B = y[x + 7],
              T = y[x + 8],
              D = y[x + 9],
              k = y[x + 10],
              W = y[x + 11],
              V = y[x + 12],
              q = y[x + 13],
              Q = y[x + 14],
              ie = y[x + 15],
              z = b[0],
              I = b[1],
              O = b[2],
              L = b[3];
            z = p(z, I, O, L, C, 7, u[0]), L = p(L, z, I, O, M, 12, u[1]), O = p(O, L, z, I, S, 17, u[2]), I = p(I, O, L, z, H, 22, u[3]), z = p(z, I, O, L, N, 7, u[4]), L = p(L, z, I, O, w, 12, u[5]), O = p(O, L, z, I, E, 17, u[6]), I = p(I, O, L, z, B, 22, u[7]), z = p(z, I, O, L, T, 7, u[8]), L = p(L, z, I, O, D, 12, u[9]), O = p(O, L, z, I, k, 17, u[10]), I = p(I, O, L, z, W, 22, u[11]), z = p(z, I, O, L, V, 7, u[12]), L = p(L, z, I, O, q, 12, u[13]), O = p(O, L, z, I, Q, 17, u[14]), I = p(I, O, L, z, ie, 22, u[15]), z = f(z, I, O, L, M, 5, u[16]), L = f(L, z, I, O, E, 9, u[17]), O = f(O, L, z, I, W, 14, u[18]), I = f(I, O, L, z, C, 20, u[19]), z = f(z, I, O, L, w, 5, u[20]), L = f(L, z, I, O, k, 9, u[21]), O = f(O, L, z, I, ie, 14, u[22]), I = f(I, O, L, z, N, 20, u[23]), z = f(z, I, O, L, D, 5, u[24]), L = f(L, z, I, O, Q, 9, u[25]), O = f(O, L, z, I, H, 14, u[26]), I = f(I, O, L, z, T, 20, u[27]), z = f(z, I, O, L, q, 5, u[28]), L = f(L, z, I, O, S, 9, u[29]), O = f(O, L, z, I, B, 14, u[30]), I = f(I, O, L, z, V, 20, u[31]), z = m(z, I, O, L, w, 4, u[32]), L = m(L, z, I, O, T, 11, u[33]), O = m(O, L, z, I, W, 16, u[34]), I = m(I, O, L, z, Q, 23, u[35]), z = m(z, I, O, L, M, 4, u[36]), L = m(L, z, I, O, N, 11, u[37]), O = m(O, L, z, I, B, 16, u[38]), I = m(I, O, L, z, k, 23, u[39]), z = m(z, I, O, L, q, 4, u[40]), L = m(L, z, I, O, C, 11, u[41]), O = m(O, L, z, I, H, 16, u[42]), I = m(I, O, L, z, E, 23, u[43]), z = m(z, I, O, L, D, 4, u[44]), L = m(L, z, I, O, V, 11, u[45]), O = m(O, L, z, I, ie, 16, u[46]), I = m(I, O, L, z, S, 23, u[47]), z = g(z, I, O, L, C, 6, u[48]), L = g(L, z, I, O, B, 10, u[49]), O = g(O, L, z, I, Q, 15, u[50]), I = g(I, O, L, z, w, 21, u[51]), z = g(z, I, O, L, V, 6, u[52]), L = g(L, z, I, O, H, 10, u[53]), O = g(O, L, z, I, k, 15, u[54]), I = g(I, O, L, z, M, 21, u[55]), z = g(z, I, O, L, T, 6, u[56]), L = g(L, z, I, O, ie, 10, u[57]), O = g(O, L, z, I, E, 15, u[58]), I = g(I, O, L, z, q, 21, u[59]), z = g(z, I, O, L, N, 6, u[60]), L = g(L, z, I, O, W, 10, u[61]), O = g(O, L, z, I, S, 15, u[62]), I = g(I, O, L, z, D, 21, u[63]), b[0] = b[0] + z | 0, b[1] = b[1] + I | 0, b[2] = b[2] + O | 0, b[3] = b[3] + L | 0
          },
          _doFinalize: function () {
            var y = this._data,
              x = y.words,
              A = this._nDataBytes * 8,
              _ = y.sigBytes * 8;
            x[_ >>> 5] |= 128 << 24 - _ % 32;
            var v = n.floor(A / 4294967296),
              b = A;
            x[(_ + 64 >>> 9 << 4) + 15] = (v << 8 | v >>> 24) & 16711935 | (v << 24 | v >>> 8) & 4278255360, x[(_ + 64 >>> 9 << 4) + 14] = (b << 8 | b >>> 24) & 16711935 | (b << 24 | b >>> 8) & 4278255360, y.sigBytes = (x.length + 1) * 4, this._process();
            for (var C = this._hash, M = C.words, S = 0; S < 4; S++) {
              var H = M[S];
              M[S] = (H << 8 | H >>> 24) & 16711935 | (H << 24 | H >>> 8) & 4278255360
            }
            return C
          },
          clone: function () {
            var y = c.clone.call(this);
            return y._hash = this._hash.clone(), y
          }
        });

        function p(y, x, A, _, v, b, C) {
          var M = y + (x & A | ~x & _) + v + C;
          return (M << b | M >>> 32 - b) + x
        }

        function f(y, x, A, _, v, b, C) {
          var M = y + (x & _ | A & ~_) + v + C;
          return (M << b | M >>> 32 - b) + x
        }

        function m(y, x, A, _, v, b, C) {
          var M = y + (x ^ A ^ _) + v + C;
          return (M << b | M >>> 32 - b) + x
        }

        function g(y, x, A, _, v, b, C) {
          var M = y + (A ^ (x | ~_)) + v + C;
          return (M << b | M >>> 32 - b) + x
        }
        s.MD5 = c._createHelper(d), s.HmacMD5 = c._createHmacHelper(d)
      }(Math), i.MD5
    })
  })(ta);
  var nn = {
      exports: {}
    },
    ia = {
      exports: {}
    };
  (function (r, e) {
    (function (i, n) {
      r.exports = n(Ve.exports)
    })(ve, function (i) {
      return function () {
        var n = i,
          s = n.lib,
          o = s.WordArray,
          a = s.Hasher,
          c = n.algo,
          h = [],
          u = c.SHA1 = a.extend({
            _doReset: function () {
              this._hash = new o.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
            },
            _doProcessBlock: function (d, p) {
              for (var f = this._hash.words, m = f[0], g = f[1], y = f[2], x = f[3], A = f[4], _ = 0; _ < 80; _++) {
                if (_ < 16) h[_] = d[p + _] | 0;
                else {
                  var v = h[_ - 3] ^ h[_ - 8] ^ h[_ - 14] ^ h[_ - 16];
                  h[_] = v << 1 | v >>> 31
                }
                var b = (m << 5 | m >>> 27) + A + h[_];
                _ < 20 ? b += (g & y | ~g & x) + 1518500249 : _ < 40 ? b += (g ^ y ^ x) + 1859775393 : _ < 60 ? b += (g & y | g & x | y & x) - 1894007588 : b += (g ^ y ^ x) - 899497514, A = x, x = y, y = g << 30 | g >>> 2, g = m, m = b
              }
              f[0] = f[0] + m | 0, f[1] = f[1] + g | 0, f[2] = f[2] + y | 0, f[3] = f[3] + x | 0, f[4] = f[4] + A | 0
            },
            _doFinalize: function () {
              var d = this._data,
                p = d.words,
                f = this._nDataBytes * 8,
                m = d.sigBytes * 8;
              return p[m >>> 5] |= 128 << 24 - m % 32, p[(m + 64 >>> 9 << 4) + 14] = Math.floor(f / 4294967296), p[(m + 64 >>> 9 << 4) + 15] = f, d.sigBytes = p.length * 4, this._process(), this._hash
            },
            clone: function () {
              var d = a.clone.call(this);
              return d._hash = this._hash.clone(), d
            }
          });
        n.SHA1 = a._createHelper(u), n.HmacSHA1 = a._createHmacHelper(u)
      }(), i.SHA1
    })
  })(ia);
  var ra = {
    exports: {}
  };
  (function (r, e) {
    (function (i, n) {
      r.exports = n(Ve.exports)
    })(ve, function (i) {
      (function () {
        var n = i,
          s = n.lib,
          o = s.Base,
          a = n.enc,
          c = a.Utf8,
          h = n.algo;
        h.HMAC = o.extend({
          init: function (u, d) {
            u = this._hasher = new u.init, typeof d == "string" && (d = c.parse(d));
            var p = u.blockSize,
              f = p * 4;
            d.sigBytes > f && (d = u.finalize(d)), d.clamp();
            for (var m = this._oKey = d.clone(), g = this._iKey = d.clone(), y = m.words, x = g.words, A = 0; A < p; A++) y[A] ^= 1549556828, x[A] ^= 909522486;
            m.sigBytes = g.sigBytes = f, this.reset()
          },
          reset: function () {
            var u = this._hasher;
            u.reset(), u.update(this._iKey)
          },
          update: function (u) {
            return this._hasher.update(u), this
          },
          finalize: function (u) {
            var d = this._hasher,
              p = d.finalize(u);
            d.reset();
            var f = d.finalize(this._oKey.clone().concat(p));
            return f
          }
        })
      })()
    })
  })(ra),
  function (r, e) {
    (function (i, n, s) {
      r.exports = n(Ve.exports, ia.exports, ra.exports)
    })(ve, function (i) {
      return function () {
        var n = i,
          s = n.lib,
          o = s.Base,
          a = s.WordArray,
          c = n.algo,
          h = c.MD5,
          u = c.EvpKDF = o.extend({
            cfg: o.extend({
              keySize: 128 / 32,
              hasher: h,
              iterations: 1
            }),
            init: function (d) {
              this.cfg = this.cfg.extend(d)
            },
            compute: function (d, p) {
              for (var f, m = this.cfg, g = m.hasher.create(), y = a.create(), x = y.words, A = m.keySize, _ = m.iterations; x.length < A;) {
                f && g.update(f), f = g.update(d).finalize(p), g.reset();
                for (var v = 1; v < _; v++) f = g.finalize(f), g.reset();
                y.concat(f)
              }
              return y.sigBytes = A * 4, y
            }
          });
        n.EvpKDF = function (d, p, f) {
          return u.create(f).compute(d, p)
        }
      }(), i.EvpKDF
    })
  }(nn);
  var Wi = {
    exports: {}
  };
  (function (r, e) {
    (function (i, n, s) {
      r.exports = n(Ve.exports, nn.exports)
    })(ve, function (i) {
      i.lib.Cipher || function (n) {
        var s = i,
          o = s.lib,
          a = o.Base,
          c = o.WordArray,
          h = o.BufferedBlockAlgorithm,
          u = s.enc;
        u.Utf8;
        var d = u.Base64,
          p = s.algo,
          f = p.EvpKDF,
          m = o.Cipher = h.extend({
            cfg: a.extend(),
            createEncryptor: function (w, E) {
              return this.create(this._ENC_XFORM_MODE, w, E)
            },
            createDecryptor: function (w, E) {
              return this.create(this._DEC_XFORM_MODE, w, E)
            },
            init: function (w, E, B) {
              this.cfg = this.cfg.extend(B), this._xformMode = w, this._key = E, this.reset()
            },
            reset: function () {
              h.reset.call(this), this._doReset()
            },
            process: function (w) {
              return this._append(w), this._process()
            },
            finalize: function (w) {
              w && this._append(w);
              var E = this._doFinalize();
              return E
            },
            keySize: 128 / 32,
            ivSize: 128 / 32,
            _ENC_XFORM_MODE: 1,
            _DEC_XFORM_MODE: 2,
            _createHelper: function () {
              function w(E) {
                return typeof E == "string" ? N : M
              }
              return function (E) {
                return {
                  encrypt: function (B, T, D) {
                    return w(T).encrypt(E, B, T, D)
                  },
                  decrypt: function (B, T, D) {
                    return w(T).decrypt(E, B, T, D)
                  }
                }
              }
            }()
          });
        o.StreamCipher = m.extend({
          _doFinalize: function () {
            var w = this._process(!0);
            return w
          },
          blockSize: 1
        });
        var g = s.mode = {},
          y = o.BlockCipherMode = a.extend({
            createEncryptor: function (w, E) {
              return this.Encryptor.create(w, E)
            },
            createDecryptor: function (w, E) {
              return this.Decryptor.create(w, E)
            },
            init: function (w, E) {
              this._cipher = w, this._iv = E
            }
          }),
          x = g.CBC = function () {
            var w = y.extend();
            w.Encryptor = w.extend({
              processBlock: function (B, T) {
                var D = this._cipher,
                  k = D.blockSize;
                E.call(this, B, T, k), D.encryptBlock(B, T), this._prevBlock = B.slice(T, T + k)
              }
            }), w.Decryptor = w.extend({
              processBlock: function (B, T) {
                var D = this._cipher,
                  k = D.blockSize,
                  W = B.slice(T, T + k);
                D.decryptBlock(B, T), E.call(this, B, T, k), this._prevBlock = W
              }
            });

            function E(B, T, D) {
              var k, W = this._iv;
              W ? (k = W, this._iv = n) : k = this._prevBlock;
              for (var V = 0; V < D; V++) B[T + V] ^= k[V]
            }
            return w
          }(),
          A = s.pad = {},
          _ = A.Pkcs7 = {
            pad: function (w, E) {
              for (var B = E * 4, T = B - w.sigBytes % B, D = T << 24 | T << 16 | T << 8 | T, k = [], W = 0; W < T; W += 4) k.push(D);
              var V = c.create(k, T);
              w.concat(V)
            },
            unpad: function (w) {
              var E = w.words[w.sigBytes - 1 >>> 2] & 255;
              w.sigBytes -= E
            }
          };
        o.BlockCipher = m.extend({
          cfg: m.cfg.extend({
            mode: x,
            padding: _
          }),
          reset: function () {
            var w;
            m.reset.call(this);
            var E = this.cfg,
              B = E.iv,
              T = E.mode;
            this._xformMode == this._ENC_XFORM_MODE ? w = T.createEncryptor : (w = T.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == w ? this._mode.init(this, B && B.words) : (this._mode = w.call(T, this, B && B.words), this._mode.__creator = w)
          },
          _doProcessBlock: function (w, E) {
            this._mode.processBlock(w, E)
          },
          _doFinalize: function () {
            var w, E = this.cfg.padding;
            return this._xformMode == this._ENC_XFORM_MODE ? (E.pad(this._data, this.blockSize), w = this._process(!0)) : (w = this._process(!0), E.unpad(w)), w
          },
          blockSize: 128 / 32
        });
        var v = o.CipherParams = a.extend({
            init: function (w) {
              this.mixIn(w)
            },
            toString: function (w) {
              return (w || this.formatter).stringify(this)
            }
          }),
          b = s.format = {},
          C = b.OpenSSL = {
            stringify: function (w) {
              var E, B = w.ciphertext,
                T = w.salt;
              return T ? E = c.create([1398893684, 1701076831]).concat(T).concat(B) : E = B, E.toString(d)
            },
            parse: function (w) {
              var E, B = d.parse(w),
                T = B.words;
              return T[0] == 1398893684 && T[1] == 1701076831 && (E = c.create(T.slice(2, 4)), T.splice(0, 4), B.sigBytes -= 16), v.create({
                ciphertext: B,
                salt: E
              })
            }
          },
          M = o.SerializableCipher = a.extend({
            cfg: a.extend({
              format: C
            }),
            encrypt: function (w, E, B, T) {
              T = this.cfg.extend(T);
              var D = w.createEncryptor(B, T),
                k = D.finalize(E),
                W = D.cfg;
              return v.create({
                ciphertext: k,
                key: B,
                iv: W.iv,
                algorithm: w,
                mode: W.mode,
                padding: W.padding,
                blockSize: w.blockSize,
                formatter: T.format
              })
            },
            decrypt: function (w, E, B, T) {
              T = this.cfg.extend(T), E = this._parse(E, T.format);
              var D = w.createDecryptor(B, T).finalize(E.ciphertext);
              return D
            },
            _parse: function (w, E) {
              return typeof w == "string" ? E.parse(w, this) : w
            }
          }),
          S = s.kdf = {},
          H = S.OpenSSL = {
            execute: function (w, E, B, T) {
              T || (T = c.random(64 / 8));
              var D = f.create({
                  keySize: E + B
                }).compute(w, T),
                k = c.create(D.words.slice(E), B * 4);
              return D.sigBytes = E * 4, v.create({
                key: D,
                iv: k,
                salt: T
              })
            }
          },
          N = o.PasswordBasedCipher = M.extend({
            cfg: M.cfg.extend({
              kdf: H
            }),
            encrypt: function (w, E, B, T) {
              T = this.cfg.extend(T);
              var D = T.kdf.execute(B, w.keySize, w.ivSize);
              T.iv = D.iv;
              var k = M.encrypt.call(this, w, E, D.key, T);
              return k.mixIn(D), k
            },
            decrypt: function (w, E, B, T) {
              T = this.cfg.extend(T), E = this._parse(E, T.format);
              var D = T.kdf.execute(B, w.keySize, w.ivSize, E.salt);
              T.iv = D.iv;
              var k = M.decrypt.call(this, w, E, D.key, T);
              return k
            }
          })
      }()
    })
  })(Wi),
  function (r, e) {
    (function (i, n, s) {
      r.exports = n(Ve.exports, ea.exports, ta.exports, nn.exports, Wi.exports)
    })(ve, function (i) {
      return function () {
        var n = i,
          s = n.lib,
          o = s.BlockCipher,
          a = n.algo,
          c = [],
          h = [],
          u = [],
          d = [],
          p = [],
          f = [],
          m = [],
          g = [],
          y = [],
          x = [];
        (function () {
          for (var v = [], b = 0; b < 256; b++) b < 128 ? v[b] = b << 1 : v[b] = b << 1 ^ 283;
          for (var C = 0, M = 0, b = 0; b < 256; b++) {
            var S = M ^ M << 1 ^ M << 2 ^ M << 3 ^ M << 4;
            S = S >>> 8 ^ S & 255 ^ 99, c[C] = S, h[S] = C;
            var H = v[C],
              N = v[H],
              w = v[N],
              E = v[S] * 257 ^ S * 16843008;
            u[C] = E << 24 | E >>> 8, d[C] = E << 16 | E >>> 16, p[C] = E << 8 | E >>> 24, f[C] = E;
            var E = w * 16843009 ^ N * 65537 ^ H * 257 ^ C * 16843008;
            m[S] = E << 24 | E >>> 8, g[S] = E << 16 | E >>> 16, y[S] = E << 8 | E >>> 24, x[S] = E, C ? (C = H ^ v[v[v[w ^ H]]], M ^= v[v[M]]) : C = M = 1
          }
        })();
        var A = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
          _ = a.AES = o.extend({
            _doReset: function () {
              var v;
              if (!(this._nRounds && this._keyPriorReset === this._key)) {
                for (var b = this._keyPriorReset = this._key, C = b.words, M = b.sigBytes / 4, S = this._nRounds = M + 6, H = (S + 1) * 4, N = this._keySchedule = [], w = 0; w < H; w++) w < M ? N[w] = C[w] : (v = N[w - 1], w % M ? M > 6 && w % M == 4 && (v = c[v >>> 24] << 24 | c[v >>> 16 & 255] << 16 | c[v >>> 8 & 255] << 8 | c[v & 255]) : (v = v << 8 | v >>> 24, v = c[v >>> 24] << 24 | c[v >>> 16 & 255] << 16 | c[v >>> 8 & 255] << 8 | c[v & 255], v ^= A[w / M | 0] << 24), N[w] = N[w - M] ^ v);
                for (var E = this._invKeySchedule = [], B = 0; B < H; B++) {
                  var w = H - B;
                  if (B % 4) var v = N[w];
                  else var v = N[w - 4];
                  B < 4 || w <= 4 ? E[B] = v : E[B] = m[c[v >>> 24]] ^ g[c[v >>> 16 & 255]] ^ y[c[v >>> 8 & 255]] ^ x[c[v & 255]]
                }
              }
            },
            encryptBlock: function (v, b) {
              this._doCryptBlock(v, b, this._keySchedule, u, d, p, f, c)
            },
            decryptBlock: function (v, b) {
              var C = v[b + 1];
              v[b + 1] = v[b + 3], v[b + 3] = C, this._doCryptBlock(v, b, this._invKeySchedule, m, g, y, x, h);
              var C = v[b + 1];
              v[b + 1] = v[b + 3], v[b + 3] = C
            },
            _doCryptBlock: function (v, b, C, M, S, H, N, w) {
              for (var E = this._nRounds, B = v[b] ^ C[0], T = v[b + 1] ^ C[1], D = v[b + 2] ^ C[2], k = v[b + 3] ^ C[3], W = 4, V = 1; V < E; V++) {
                var q = M[B >>> 24] ^ S[T >>> 16 & 255] ^ H[D >>> 8 & 255] ^ N[k & 255] ^ C[W++],
                  Q = M[T >>> 24] ^ S[D >>> 16 & 255] ^ H[k >>> 8 & 255] ^ N[B & 255] ^ C[W++],
                  ie = M[D >>> 24] ^ S[k >>> 16 & 255] ^ H[B >>> 8 & 255] ^ N[T & 255] ^ C[W++],
                  z = M[k >>> 24] ^ S[B >>> 16 & 255] ^ H[T >>> 8 & 255] ^ N[D & 255] ^ C[W++];
                B = q, T = Q, D = ie, k = z
              }
              var q = (w[B >>> 24] << 24 | w[T >>> 16 & 255] << 16 | w[D >>> 8 & 255] << 8 | w[k & 255]) ^ C[W++],
                Q = (w[T >>> 24] << 24 | w[D >>> 16 & 255] << 16 | w[k >>> 8 & 255] << 8 | w[B & 255]) ^ C[W++],
                ie = (w[D >>> 24] << 24 | w[k >>> 16 & 255] << 16 | w[B >>> 8 & 255] << 8 | w[T & 255]) ^ C[W++],
                z = (w[k >>> 24] << 24 | w[B >>> 16 & 255] << 16 | w[T >>> 8 & 255] << 8 | w[D & 255]) ^ C[W++];
              v[b] = q, v[b + 1] = Q, v[b + 2] = ie, v[b + 3] = z
            },
            keySize: 256 / 32
          });
        n.AES = o._createHelper(_)
      }(), i.AES
    })
  }(Zo);
  var na = Zo.exports,
    sa = {
      exports: {}
    };
  (function (r, e) {
    (function (i, n, s) {
      r.exports = n(Ve.exports, Wi.exports)
    })(ve, function (i) {
      return i.mode.ECB = function () {
        var n = i.lib.BlockCipherMode.extend();
        return n.Encryptor = n.extend({
          processBlock: function (s, o) {
            this._cipher.encryptBlock(s, o)
          }
        }), n.Decryptor = n.extend({
          processBlock: function (s, o) {
            this._cipher.decryptBlock(s, o)
          }
        }), n
      }(), i.mode.ECB
    })
  })(sa);
  var oa = sa.exports,
    aa = {
      exports: {}
    };
  (function (r, e) {
    (function (i, n, s) {
      r.exports = n(Ve.exports, Wi.exports)
    })(ve, function (i) {
      return i.pad.Pkcs7
    })
  })(aa);
  var la = aa.exports,
    Nf = {
      encrypt(r, e) {
        let i = Vi.parse(e),
          n = Vi.parse(r);
        return na.encrypt(n, i, {
          mode: oa,
          padding: la
        }).toString()
      },
      decrypt(r, e) {
        let i = Vi.parse(e),
          n = na.decrypt(r, i, {
            mode: oa,
            padding: la
          });
        return Vi.stringify(n).toString()
      }
    },
    Uf = "",
    e0 = "",
    ci, te, ca, ha, hi, ua, da, pa, ji = {},
    fa = [],
    Vf = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;

  function Ke(r, e) {
    for (var i in e) r[i] = e[i];
    return r
  }

  function ma(r) {
    var e = r.parentNode;
    e && e.removeChild(r)
  }

  function qi(r, e, i) {
    var n, s, o, a = {};
    for (o in e) o == "key" ? n = e[o] : o == "ref" ? s = e[o] : a[o] = e[o];
    if (arguments.length > 2 && (a.children = arguments.length > 3 ? ci.call(arguments, 2) : i), typeof r == "function" && r.defaultProps != null)
      for (o in r.defaultProps) a[o] === void 0 && (a[o] = r.defaultProps[o]);
    return ui(r, a, n, s, null)
  }

  function ui(r, e, i, n, s) {
    var o = {
      type: r,
      props: e,
      key: i,
      ref: n,
      __k: null,
      __: null,
      __b: 0,
      __e: null,
      __d: void 0,
      __c: null,
      __h: null,
      constructor: void 0,
      __v: s == null ? ++ca : s
    };
    return s == null && te.vnode != null && te.vnode(o), o
  }

  function Wf() {
    return {
      current: null
    }
  }

  function di(r) {
    return r.children
  }

  function pi(r, e) {
    this.props = r, this.context = e
  }

  function Ft(r, e) {
    if (e == null) return r.__ ? Ft(r.__, r.__.__k.indexOf(r) + 1) : null;
    for (var i; e < r.__k.length; e++)
      if ((i = r.__k[e]) != null && i.__e != null) return i.__e;
    return typeof r.type == "function" ? Ft(r) : null
  }

  function ga(r) {
    var e, i;
    if ((r = r.__) != null && r.__c != null) {
      for (r.__e = r.__c.base = null, e = 0; e < r.__k.length; e++)
        if ((i = r.__k[e]) != null && i.__e != null) {
          r.__e = r.__c.base = i.__e;
          break
        } return ga(r)
    }
  }

  function sn(r) {
    (!r.__d && (r.__d = !0) && hi.push(r) && !Qi.__r++ || da !== te.debounceRendering) && ((da = te.debounceRendering) || ua)(Qi)
  }

  function Qi() {
    for (var r; Qi.__r = hi.length;) r = hi.sort(function (e, i) {
      return e.__v.__b - i.__v.__b
    }), hi = [], r.some(function (e) {
      var i, n, s, o, a, c;
      e.__d && (a = (o = (i = e).__v).__e, (c = i.__P) && (n = [], (s = Ke({}, o)).__v = o.__v + 1, on(c, o, s, i.__n, c.ownerSVGElement !== void 0, o.__h != null ? [a] : null, n, a == null ? Ft(o) : a, o.__h), Aa(n, o), o.__e != a && ga(o)))
    })
  }

  function ya(r, e, i, n, s, o, a, c, h, u) {
    var d, p, f, m, g, y, x, A = n && n.__k || fa,
      _ = A.length;
    for (i.__k = [], d = 0; d < e.length; d++)
      if ((m = i.__k[d] = (m = e[d]) == null || typeof m == "boolean" ? null : typeof m == "string" || typeof m == "number" || typeof m == "bigint" ? ui(null, m, null, null, m) : Array.isArray(m) ? ui(di, {
          children: m
        }, null, null, null) : m.__b > 0 ? ui(m.type, m.props, m.key, null, m.__v) : m) != null) {
        if (m.__ = i, m.__b = i.__b + 1, (f = A[d]) === null || f && m.key == f.key && m.type === f.type) A[d] = void 0;
        else
          for (p = 0; p < _; p++) {
            if ((f = A[p]) && m.key == f.key && m.type === f.type) {
              A[p] = void 0;
              break
            }
            f = null
          }
        on(r, m, f = f || ji, s, o, a, c, h, u), g = m.__e, (p = m.ref) && f.ref != p && (x || (x = []), f.ref && x.push(f.ref, null, m), x.push(p, m.__c || g, m)), g != null ? (y == null && (y = g), typeof m.type == "function" && m.__k === f.__k ? m.__d = h = va(m, h, r) : h = wa(r, m, f, A, g, h), typeof i.type == "function" && (i.__d = h)) : h && f.__e == h && h.parentNode != r && (h = Ft(f))
      } for (i.__e = y, d = _; d--;) A[d] != null && (typeof i.type == "function" && A[d].__e != null && A[d].__e == i.__d && (i.__d = Ft(n, d + 1)), Sa(A[d], A[d]));
    if (x)
      for (d = 0; d < x.length; d++) Pa(x[d], x[++d], x[++d])
  }

  function va(r, e, i) {
    for (var n, s = r.__k, o = 0; s && o < s.length; o++)(n = s[o]) && (n.__ = r, e = typeof n.type == "function" ? va(n, e, i) : wa(i, n, n, s, n.__e, e));
    return e
  }

  function _a(r, e) {
    return e = e || [], r == null || typeof r == "boolean" || (Array.isArray(r) ? r.some(function (i) {
      _a(i, e)
    }) : e.push(r)), e
  }

  function wa(r, e, i, n, s, o) {
    var a, c, h;
    if (e.__d !== void 0) a = e.__d, e.__d = void 0;
    else if (i == null || s != o || s.parentNode == null) e: if (o == null || o.parentNode !== r) r.appendChild(s), a = null;
      else {
        for (c = o, h = 0;
          (c = c.nextSibling) && h < n.length; h += 2)
          if (c == s) break e;
        r.insertBefore(s, o), a = o
      } return a !== void 0 ? a : s.nextSibling
  }

  function jf(r, e, i, n, s) {
    var o;
    for (o in i) o === "children" || o === "key" || o in e || Yi(r, o, null, i[o], n);
    for (o in e) s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || i[o] === e[o] || Yi(r, o, e[o], i[o], n)
  }

  function Ca(r, e, i) {
    e[0] === "-" ? r.setProperty(e, i) : r[e] = i == null ? "" : typeof i != "number" || Vf.test(e) ? i : i + "px"
  }

  function Yi(r, e, i, n, s) {
    var o;
    e: if (e === "style")
      if (typeof i == "string") r.style.cssText = i;
      else {
        if (typeof n == "string" && (r.style.cssText = n = ""), n)
          for (e in n) i && e in i || Ca(r.style, e, "");
        if (i)
          for (e in i) n && i[e] === n[e] || Ca(r.style, e, i[e])
      }
    else if (e[0] === "o" && e[1] === "n") o = e !== (e = e.replace(/Capture$/, "")), e = e.toLowerCase() in r ? e.toLowerCase().slice(2) : e.slice(2), r.l || (r.l = {}), r.l[e + o] = i, i ? n || r.addEventListener(e, o ? ba : xa, o) : r.removeEventListener(e, o ? ba : xa, o);
    else if (e !== "dangerouslySetInnerHTML") {
      if (s) e = e.replace(/xlink[H:h]/, "h").replace(/sName$/, "s");
      else if (e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e in r) try {
        r[e] = i == null ? "" : i;
        break e
      } catch {}
      typeof i == "function" || (i != null && (i !== !1 || e[0] === "a" && e[1] === "r") ? r.setAttribute(e, i) : r.removeAttribute(e))
    }
  }

  function xa(r) {
    this.l[r.type + !1](te.event ? te.event(r) : r)
  }

  function ba(r) {
    this.l[r.type + !0](te.event ? te.event(r) : r)
  }

  function on(r, e, i, n, s, o, a, c, h) {
    var u, d, p, f, m, g, y, x, A, _, v, b = e.type;
    if (e.constructor !== void 0) return null;
    i.__h != null && (h = i.__h, c = e.__e = i.__e, e.__h = null, o = [c]), (u = te.__b) && u(e);
    try {
      e: if (typeof b == "function") {
        if (x = e.props, A = (u = b.contextType) && n[u.__c], _ = u ? A ? A.props.value : u.__ : n, i.__c ? y = (d = e.__c = i.__c).__ = d.__E : ("prototype" in b && b.prototype.render ? e.__c = d = new b(x, _) : (e.__c = d = new pi(x, _), d.constructor = b, d.render = Qf), A && A.sub(d), d.props = x, d.state || (d.state = {}), d.context = _, d.__n = n, p = d.__d = !0, d.__h = []), d.__s == null && (d.__s = d.state), b.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = Ke({}, d.__s)), Ke(d.__s, b.getDerivedStateFromProps(x, d.__s))), f = d.props, m = d.state, p) b.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), d.componentDidMount != null && d.__h.push(d.componentDidMount);
        else {
          if (b.getDerivedStateFromProps == null && x !== f && d.componentWillReceiveProps != null && d.componentWillReceiveProps(x, _), !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(x, d.__s, _) === !1 || e.__v === i.__v) {
            d.props = x, d.state = d.__s, e.__v !== i.__v && (d.__d = !1), d.__v = e, e.__e = i.__e, e.__k = i.__k, e.__k.forEach(function (C) {
              C && (C.__ = e)
            }), d.__h.length && a.push(d);
            break e
          }
          d.componentWillUpdate != null && d.componentWillUpdate(x, d.__s, _), d.componentDidUpdate != null && d.__h.push(function () {
            d.componentDidUpdate(f, m, g)
          })
        }
        d.context = _, d.props = x, d.state = d.__s, (u = te.__r) && u(e), d.__d = !1, d.__v = e, d.__P = r, u = d.render(d.props, d.state, d.context), d.state = d.__s, d.getChildContext != null && (n = Ke(Ke({}, n), d.getChildContext())), p || d.getSnapshotBeforeUpdate == null || (g = d.getSnapshotBeforeUpdate(f, m)), v = u != null && u.type === di && u.key == null ? u.props.children : u, ya(r, Array.isArray(v) ? v : [v], e, i, n, s, o, a, c, h), d.base = e.__e, e.__h = null, d.__h.length && a.push(d), y && (d.__E = d.__ = null), d.__e = !1
      } else o == null && e.__v === i.__v ? (e.__k = i.__k, e.__e = i.__e) : e.__e = qf(i.__e, e, i, n, s, o, a, h);
      (u = te.diffed) && u(e)
    }
    catch (C) {
      e.__v = null, (h || o != null) && (e.__e = c, e.__h = !!h, o[o.indexOf(c)] = null), te.__e(C, e, i)
    }
  }

  function Aa(r, e) {
    te.__c && te.__c(e, r), r.some(function (i) {
      try {
        r = i.__h, i.__h = [], r.some(function (n) {
          n.call(i)
        })
      } catch (n) {
        te.__e(n, i.__v)
      }
    })
  }

  function qf(r, e, i, n, s, o, a, c) {
    var h, u, d, p = i.props,
      f = e.props,
      m = e.type,
      g = 0;
    if (m === "svg" && (s = !0), o != null) {
      for (; g < o.length; g++)
        if ((h = o[g]) && "setAttribute" in h == !!m && (m ? h.localName === m : h.nodeType === 3)) {
          r = h, o[g] = null;
          break
        }
    }
    if (r == null) {
      if (m === null) return document.createTextNode(f);
      r = s ? document.createElementNS("http://www.w3.org/2000/svg", m) : document.createElement(m, f.is && f), o = null, c = !1
    }
    if (m === null) p === f || c && r.data === f || (r.data = f);
    else {
      if (o = o && ci.call(r.childNodes), u = (p = i.props || ji).dangerouslySetInnerHTML, d = f.dangerouslySetInnerHTML, !c) {
        if (o != null)
          for (p = {}, g = 0; g < r.attributes.length; g++) p[r.attributes[g].name] = r.attributes[g].value;
        (d || u) && (d && (u && d.__html == u.__html || d.__html === r.innerHTML) || (r.innerHTML = d && d.__html || ""))
      }
      if (jf(r, f, p, s, c), d) e.__k = [];
      else if (g = e.props.children, ya(r, Array.isArray(g) ? g : [g], e, i, n, s && m !== "foreignObject", o, a, o ? o[0] : i.__k && Ft(i, 0), c), o != null)
        for (g = o.length; g--;) o[g] != null && ma(o[g]);
      c || ("value" in f && (g = f.value) !== void 0 && (g !== p.value || g !== r.value || m === "progress" && !g) && Yi(r, "value", g, p.value, !1), "checked" in f && (g = f.checked) !== void 0 && g !== r.checked && Yi(r, "checked", g, p.checked, !1))
    }
    return r
  }

  function Pa(r, e, i) {
    try {
      typeof r == "function" ? r(e) : r.current = e
    } catch (n) {
      te.__e(n, i)
    }
  }

  function Sa(r, e, i) {
    var n, s;
    if (te.unmount && te.unmount(r), (n = r.ref) && (n.current && n.current !== r.__e || Pa(n, null, e)), (n = r.__c) != null) {
      if (n.componentWillUnmount) try {
        n.componentWillUnmount()
      } catch (o) {
        te.__e(o, e)
      }
      n.base = n.__P = null
    }
    if (n = r.__k)
      for (s = 0; s < n.length; s++) n[s] && Sa(n[s], e, typeof r.type != "function");
    i || r.__e == null || ma(r.__e), r.__e = r.__d = void 0
  }

  function Qf(r, e, i) {
    return this.constructor(r, i)
  }

  function fi(r, e, i) {
    var n, s, o;
    te.__ && te.__(r, e), s = (n = typeof i == "function") ? null : i && i.__k || e.__k, o = [], on(e, r = (!n && i || e).__k = qi(di, null, [r]), s || ji, ji, e.ownerSVGElement !== void 0, !n && i ? [i] : s ? null : e.firstChild ? ci.call(e.childNodes) : null, o, !n && i ? i : s ? s.__e : e.firstChild, n), Aa(o, r)
  }

  function Ta(r, e) {
    fi(r, e, Ta)
  }

  function Yf(r, e, i) {
    var n, s, o, a = Ke({}, r.props);
    for (o in e) o == "key" ? n = e[o] : o == "ref" ? s = e[o] : a[o] = e[o];
    return arguments.length > 2 && (a.children = arguments.length > 3 ? ci.call(arguments, 2) : i), ui(r.type, a, n || r.key, s || r.ref, null)
  }

  function Xf(r, e) {
    var i = {
      __c: e = "__cC" + pa++,
      __: r,
      Consumer: function (n, s) {
        return n.children(s)
      },
      Provider: function (n) {
        var s, o;
        return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function () {
          return o
        }, this.shouldComponentUpdate = function (a) {
          this.props.value !== a.value && s.some(sn)
        }, this.sub = function (a) {
          s.push(a);
          var c = a.componentWillUnmount;
          a.componentWillUnmount = function () {
            s.splice(s.indexOf(a), 1), c && c.call(a)
          }
        }), n.children
      }
    };
    return i.Provider.__ = i.Consumer.contextType = i
  }
  ci = fa.slice, te = {
    __e: function (r, e) {
      for (var i, n, s; e = e.__;)
        if ((i = e.__c) && !i.__) try {
          if ((n = i.constructor) && n.getDerivedStateFromError != null && (i.setState(n.getDerivedStateFromError(r)), s = i.__d), i.componentDidCatch != null && (i.componentDidCatch(r), s = i.__d), s) return i.__E = i
        } catch (o) {
          r = o
        }
      throw r
    }
  }, ca = 0, ha = function (r) {
    return r != null && r.constructor === void 0
  }, pi.prototype.setState = function (r, e) {
    var i;
    i = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Ke({}, this.state), typeof r == "function" && (r = r(Ke({}, i), this.props)), r && Ke(i, r), r != null && this.__v && (e && this.__h.push(e), sn(this))
  }, pi.prototype.forceUpdate = function (r) {
    this.__v && (this.__e = !0, r && this.__h.push(r), sn(this))
  }, pi.prototype.render = di, hi = [], ua = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Qi.__r = 0, pa = 0;
  var Kf = Object.freeze({
      __proto__: null,
      [Symbol.toStringTag]: "Module",
      render: fi,
      hydrate: Ta,
      createElement: qi,
      h: qi,
      Fragment: di,
      createRef: Wf,
      get isValidElement() {
        return ha
      },
      Component: pi,
      cloneElement: Yf,
      createContext: Xf,
      toChildArray: _a,
      get options() {
        return te
      }
    }),
    Ma, We, Ea, an = 0,
    ln = [],
    Da = te.__b,
    ka = te.__r,
    za = te.diffed,
    Ia = te.__c,
    Oa = te.unmount;

  function Jf(r, e) {
    te.__h && te.__h(We, r, an || e), an = 0;
    var i = We.__H || (We.__H = {
      __: [],
      __h: []
    });
    return r >= i.__.length && i.__.push({}), i.__[r]
  }

  function $f(r) {
    return an = 1, Zf(Ba, r)
  }

  function Zf(r, e, i) {
    var n = Jf(Ma++, 2);
    return n.t = r, n.__c || (n.__ = [i ? i(e) : Ba(void 0, e), function (s) {
      var o = n.t(n.__[0], s);
      n.__[0] !== o && (n.__ = [o, n.__[1]], n.__c.setState({}))
    }], n.__c = We), n.__
  }

  function em() {
    var r;
    for (ln.sort(function (e, i) {
        return e.__v.__b - i.__v.__b
      }); r = ln.pop();)
      if (r.__P) try {
        r.__H.__h.forEach(Xi), r.__H.__h.forEach(cn), r.__H.__h = []
      } catch (e) {
        r.__H.__h = [], te.__e(e, r.__v)
      }
  }
  te.__b = function (r) {
    We = null, Da && Da(r)
  }, te.__r = function (r) {
    ka && ka(r), Ma = 0;
    var e = (We = r.__c).__H;
    e && (e.__h.forEach(Xi), e.__h.forEach(cn), e.__h = [])
  }, te.diffed = function (r) {
    za && za(r);
    var e = r.__c;
    e && e.__H && e.__H.__h.length && (ln.push(e) !== 1 && Ea === te.requestAnimationFrame || ((Ea = te.requestAnimationFrame) || function (i) {
      var n, s = function () {
          clearTimeout(o), Ra && cancelAnimationFrame(n), setTimeout(i)
        },
        o = setTimeout(s, 100);
      Ra && (n = requestAnimationFrame(s))
    })(em)), We = null
  }, te.__c = function (r, e) {
    e.some(function (i) {
      try {
        i.__h.forEach(Xi), i.__h = i.__h.filter(function (n) {
          return !n.__ || cn(n)
        })
      } catch (n) {
        e.some(function (s) {
          s.__h && (s.__h = [])
        }), e = [], te.__e(n, i.__v)
      }
    }), Ia && Ia(r, e)
  }, te.unmount = function (r) {
    Oa && Oa(r);
    var e, i = r.__c;
    i && i.__H && (i.__H.__.forEach(function (n) {
      try {
        Xi(n)
      } catch (s) {
        e = s
      }
    }), e && te.__e(e, i.__v))
  };
  var Ra = typeof requestAnimationFrame == "function";

  function Xi(r) {
    var e = We,
      i = r.__c;
    typeof i == "function" && (r.__c = void 0, i()), We = e
  }

  function cn(r) {
    var e = We;
    r.__c = r.__(), We = e
  }

  function Ba(r, e) {
    return typeof e == "function" ? e(r) : e
  }
  var tm = Ph(Kf),
    La, Ga, Fa, hn = tm,
    im = 0;

  function Ha(r, e, i, n, s) {
    var o, a, c = {};
    for (a in e) a == "ref" ? o = e[a] : c[a] = e[a];
    var h = {
      type: r,
      props: c,
      key: i,
      ref: o,
      __k: null,
      __: null,
      __b: 0,
      __e: null,
      __d: void 0,
      __c: null,
      __h: null,
      constructor: void 0,
      __v: --im,
      __source: n,
      __self: s
    };
    if (typeof r == "function" && (o = r.defaultProps))
      for (a in o) c[a] === void 0 && (c[a] = o[a]);
    return hn.options.vnode && hn.options.vnode(h), h
  }
  Fa = hn.Fragment, Ga = Ha, La = Ha;
  const vt = Ga,
    un = La,
    rm = Fa,
    Na = 5;

  function nm({
    floors: r,
    focusFloorId: e,
    setFocusFloorId: i,
    floorHeight: n,
    setFloorHeight: s,
    resetFloorHeight: o
  }) {
    const [a, c] = $f(0);
    if (!r.length) return vt(rm, {});
    const h = r.slice(a, a + Na),
      u = a <= 0,
      d = a + Na >= r.length;
    return un("div", {
      className: "le-floor-control",
      children: [un("div", {
        className: "le-floor-btn-box",
        children: [vt("div", {
          className: "le-floor-close",
          onClick: o
        }), vt("div", {
          onClick: () => {
            U(e) && i(null)
          },
          className: Ki({
            "le-floor-switcher": !0,
            "le-floor-switcher-multiple": !e
          })
        }), un("div", {
          children: [(!u || !d) && vt("div", {
            className: Ki({
              "le-floor-btn le-floor-btn__up": !0,
              disabled: u
            }),
            onClick: () => {
              u || c(a - 1)
            }
          }), h.map(({
            label: p,
            value: f
          }) => vt("div", {
            className: Ki({
              "le-floor-btn": !0,
              select: f === e
            }),
            onClick: () => i(f),
            children: p
          }, f)), (!u || !d) && vt("div", {
            className: Ki({
              "le-floor-btn le-floor-btn__down": !0,
              disabled: d
            }),
            onClick: () => {
              d || c(a + 1)
            }
          })]
        })]
      }), vt("input", {
        type: "range",
        max: 50,
        min: 0,
        step: 1,
        className: "le-floor-range",
        value: n,
        onInput: p => {
          s(p.target.value)
        }
      })]
    })
  }

  function Ki(r) {
    return Object.entries(r).map(([e, i]) => {
      if (i) return e
    }).filter(Boolean).join(" ")
  }
  class Ua extends Gt {
    constructor(e, s = {}) {
      var o = s,
        {
          tileset: i
        } = o,
        n = re(o, ["tileset"]);
      Re(e) && (e = JSON.parse(Nf.decrypt(e, "Z2jPradpfqnnIsFt")));
      super(ne({
        showBillboard: !0,
        showControl: !0,
        floorHeight: 25,
        labelStyle: {},
        billboardStyle: {}
      }, n));
      P(this, "floors", []);
      P(this, "buildings", []);
      P(this, "tileset", null);
      P(this, "clipById", !1);
      P(this, "_floorHeight", 25);
      P(this, "_focusBuildingId", null);
      P(this, "_focusFloorId", null);
      this.tileset = i, this.data = e, U(e.clipById) && (this.clipById = e.clipById)
    }
    setOptions({
      showBillboard: e,
      showControl: i
    }) {
      U(i) && (this.options.showControl = i, this.renderDom()), U(e) && (this.options.showBillboard = e, this.group && this.group.graphics.forEach(n => {
        n.type === "billboard" && (e ? n.show() : n.hide())
      }))
    }
    flyTo() {
      this.tileset && this.tileset.flyTo()
    }
    destroy() {
      this.group && (this.group.destroy(), this.group = null), this.tileset = null, this._map && (fi(null, this._map.container), this._map = null), super.destroy()
    }
    _addedHook() {
      this.renderDom();
      const e = this._map;
      this.group = new pt().addTo(e);
      const {
        tileUrl: i,
        floors: n,
        position: s,
        buildings: o,
        rotate: a
      } = this.data;
      this.tileset || (this.tileset = new Gi({
        position: s,
        rotate: a,
        style: {
          url: i
        }
      }).addTo(this.group)), n && (n.find(h => h.id < 0) && (e.viewer.scene.globe.depthTestAgainstTerrain = !1), this.floors = n.map(({
        position: h,
        tileUrl: u,
        id: d,
        rotate: p
      }) => {
        const f = this._getFloorNameById(d);
        return new Gi({
          id: f,
          style: {
            url: u
          },
          attr: {
            position: h,
            floorName: f,
            rotate: p,
            id: d
          }
        }).addTo(this.group)
      }), this._updateFloorHeight(), this.setTilesetShowStyle()), o && this.options.showBillboard && (this.buildings = o.map(({
        position: c,
        clipRegion: h,
        id: u,
        name: d
      }) => {
        const p = new qr({
          position: c,
          style: j({
            image: Uf,
            width: 56,
            height: 61,
            scale: .6,
            distanceDisplayCondition: [0, 2e3],
            scaleByDistance: [0, 1.2, 2e3, .75],
            label: j({
              text: d,
              fontSize: 16,
              color: "#fff",
              outlineColor: "#000",
              outlineWidth: 2,
              pixelOffset: [0, -50],
              fontWeight: "bold",
              distanceDisplayCondition: [0, 2e3],
              scaleByDistance: [0, 1.2, 2e3, .75]
            }, this.options.labelStyle)
          }, this.options.billboardStyle),
          attr: {
            buildingId: u
          }
        }).addTo(this.group);
        return p.on("click", () => {
          this.focusBuildingId = u
        }), p
      }))
    }
    get floorHeight() {
      return this.options.floorHeight
    }
    set floorHeight(e) {
      this.options.floorHeight = e, this.fire("update:floorHeight", e), this._updateFloorHeight(), this.renderDom()
    }
    _updateFloorHeight() {
      this.floors.forEach(e => {
        const {
          position: i,
          rotate: n,
          id: s
        } = e.attr;
        e.moveTo(new R(i).addHeight(this.floorHeight * (s > 0 ? s - 1 : s)), n)
      })
    }
    get focusBuildingId() {
      return this._focusBuildingId
    }
    set focusBuildingId(e) {
      this.focusFloorId && (this.focusFloorId = null), this._focusBuildingId = e, this.setTilesetShowStyle(), this.buildings.forEach(i => {
        i.attr.buildingId === e ? i.hide() : i.show()
      }), this.renderDom(), this.fire("update:focusBuilding", e), this.focusBuilding ? this.clipById ? this.tileset.setShowStyle(`\${name} !== '${this.focusBuildingId}'`) : this.tileset.clip(this.focusBuilding.clipRegion.coordinates[0]) : this.clipById ? this.tileset.setShowStyle() : this.tileset.clip([])
    }
    get focusBuilding() {
      return ce(this.focusBuildingId) ? null : this.data.buildings.find(e => e.id === this.focusBuildingId)
    }
    get focusFloorId() {
      return this._focusFloorId
    }
    set focusFloorId(e) {
      this._focusFloorId = e, this.setTilesetShowStyle(), this.fire("update:focusFloor", e), this.renderDom()
    }
    setTilesetShowStyle() {
      let e = "";
      if (this.focusFloorId)
        if (Ie(this.focusFloorId)) {
          const i = this.focusFloorId.map(n => this._getFloorNameById(n)).join("|");
          e = `(regExp('^${this.focusBuildingId}(${i})').test(\${name}))`
        } else {
          const i = this._getFloorNameById(this.focusFloorId);
          e = `\${name} === '${this.focusBuildingId}${i}'`
        }
      else e = `(regExp('^${this.focusBuildingId}[F|B]').test(\${name}))`;
      this.setTilesetShowExpression(e)
    }
    setTilesetShowExpression(e) {
      this.floors.forEach(i => {
        i.setShowStyle(e)
      })
    }
    renderDom() {
      var i, n;
      if (!this.options.showControl) {
        fi(null, this._map.container);
        return
      }
      const e = (n = (i = this.focusBuilding) == null ? void 0 : i.floorIds.map(s => ({
        value: s,
        label: this._getFloorNameById(s)
      }))) != null ? n : [];
      fi(qi(nm, {
        focusFloorId: this.focusFloorId,
        floors: e,
        floorHeight: this.floorHeight,
        setFloorHeight: s => {
          this.floorHeight = s
        },
        setFocusFloorId: s => {
          this.focusFloorId = s
        },
        resetFloorHeight: () => {
          this.focusBuildingId = null
        }
      }), this._map.container)
    }
    _getFloorNameById(e) {
      return e > 0 ? `F${e}` : `B${e}`
    }
  }
  var t0 = "";
  const sm = function (r) {
    var e = document.createElement("div");
    e.innerHTML = r;
    for (var i = document.createDocumentFragment(); e.firstChild;) i.appendChild(e.firstChild);
    return i
  };
  var om = Cesium.knockout,
    Va = function (r, e, i) {
      e = Cesium.getElement(e);
      var n = sm(r),
        s = [],
        o;
      for (o = 0; o < n.childNodes.length; ++o) s.push(n.childNodes[o]);
      for (e.appendChild(n), o = 0; o < s.length; ++o) {
        var a = s[o];
        (a.nodeType === 1 || a.nodeType === 8) && om.applyBindings(i, a)
      }
      return s
    },
    am = Cesium.knockout,
    mi = function (r) {
      if (!Cesium.defined(r) || !Cesium.defined(r.terria)) throw new Cesium.DeveloperError("options.terria is required.");
      this.terria = r.terria, this._removeSubscription = void 0, this._lastLegendUpdate = void 0, this.eventHelper = new Cesium.EventHelper, this.distanceLabel = void 0, this.barWidth = void 0, this.enableDistanceLegend = Cesium.defined(r.enableDistanceLegend) ? r.enableDistanceLegend : !0, am.track(this, ["distanceLabel", "barWidth"]), this.eventHelper.add(this.terria.afterWidgetChanged, function () {
        Cesium.defined(this._removeSubscription) && (this._removeSubscription(), this._removeSubscription = void 0)
      }, this);
      var e = this;

      function i() {
        if (Cesium.defined(e.terria)) {
          var n = e.terria.scene;
          e._removeSubscription = n.postRender.addEventListener(function () {
            lm(this, n)
          }, e)
        }
      }
      i(), this.eventHelper.add(this.terria.afterWidgetChanged, function () {
        i()
      }, this)
    };
  mi.prototype.destroy = function () {
    this.eventHelper.removeAll()
  }, mi.prototype.show = function (r) {
    var e;
    this.enableDistanceLegend ? e = `<div class="distance-legend" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label" data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar" data-bind="style: { width: barWidth + 'px', left: (5 + (125 - barWidth) / 2) + 'px' }"></div></div>` : e = `<div class="distance-legend"  style="display: none;" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label"  data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar"  data-bind="style: { width: barWidth + 'px', left: (5 + (125 - barWidth) / 2) + 'px' }"></div></div>`, Va(e, r, this)
  }, mi.create = function (r) {
    var e = new mi(r);
    return e.show(r.container), e
  };
  var Wa = new Cesium.EllipsoidGeodesic,
    dn = [1, 2, 3, 5, 10, 20, 30, 50, 100, 200, 300, 500, 1e3, 2e3, 3e3, 5e3, 1e4, 2e4, 3e4, 5e4, 1e5, 2e5, 3e5, 5e5, 1e6, 2e6, 3e6, 5e6, 1e7, 2e7, 3e7, 5e7];

  function lm(r, e) {
    if (!r.enableDistanceLegend) {
      r.barWidth = void 0, r.distanceLabel = void 0;
      return
    }
    var i = Cesium.getTimestamp();
    if (!(i < r._lastLegendUpdate + 250)) {
      r._lastLegendUpdate = i;
      var n = e.canvas.clientWidth,
        s = e.canvas.clientHeight,
        o = e.camera.getPickRay(new Cesium.Cartesian2(n / 2 | 0, s - 1)),
        a = e.camera.getPickRay(new Cesium.Cartesian2(1 + n / 2 | 0, s - 1)),
        c = e.globe,
        h = c.pick(o, e),
        u = c.pick(a, e);
      if (!Cesium.defined(h) || !Cesium.defined(u)) {
        r.barWidth = void 0, r.distanceLabel = void 0;
        return
      }
      var d = c.ellipsoid.cartesianToCartographic(h),
        p = c.ellipsoid.cartesianToCartographic(u);
      Wa.setEndPoints(d, p);
      for (var f = Wa.surfaceDistance, m = 100, g, y = dn.length - 1; !Cesium.defined(g) && y >= 0; --y) dn[y] / f < m && (g = dn[y]);
      if (Cesium.defined(g)) {
        var x;
        g >= 1e3 ? x = (g / 1e3).toString() + " km" : x = g.toString() + " m", r.barWidth = g / f | 0, r.distanceLabel = x
      } else r.barWidth = void 0, r.distanceLabel = void 0
    }
  }
  var cm = "M 7.5,0 C 3.375,0 0,3.375 0,7.5 0,11.625 3.375,15 7.5,15 c 3.46875,0 6.375,-2.4375 7.21875,-5.625 l -1.96875,0 C 12,11.53125 9.9375,13.125 7.5,13.125 4.40625,13.125 1.875,10.59375 1.875,7.5 1.875,4.40625 4.40625,1.875 7.5,1.875 c 1.59375,0 2.90625,0.65625 3.9375,1.6875 l -3,3 6.5625,0 L 15,0 12.75,2.25 C 11.4375,0.84375 9.5625,0 7.5,0 z",
    hm = Cesium.knockout,
    Ji = function (r) {
      if (!Cesium.defined(r)) throw new Cesium.DeveloperError("terria is required");
      this._terria = r, this.name = "Unnamed Control", this.text = void 0, this.svgIcon = void 0, this.svgHeight = void 0, this.svgWidth = void 0, this.cssClass = void 0, this.isActive = !1, hm.track(this, ["name", "svgIcon", "svgHeight", "svgWidth", "cssClass", "isActive"])
    };
  Object.defineProperties(Ji.prototype, {
    terria: {
      get: function () {
        return this._terria
      }
    },
    hasText: {
      get: function () {
        return Cesium.defined(this.text) && typeof this.text == "string"
      }
    }
  }), Ji.prototype.activate = function () {
    throw new Cesium.DeveloperError("activate must be implemented in the derived class.")
  };
  var gi = function (r) {
    Ji.apply(this, arguments)
  };
  gi.prototype = Object.create(Ji.prototype);
  var yi = function (r) {
    gi.apply(this, arguments), this.name = r.options.resetTooltip ? r.options.resetTooltip : "\u91CD\u7F6E\u89C6\u56FE", this.navigationLocked = !1, this.svgIcon = r.options.resetSvg ? "" : cm, this.resetSvg = r.options.resetSvg, this.svgHeight = 15, this.svgWidth = 15, this.cssClass = "navigation-control-icon-reset"
  };
  yi.prototype = Object.create(gi.prototype), yi.prototype.setNavigationLocked = function (r) {
    this.navigationLocked = r
  }, yi.prototype.resetView = function () {
    if (!this.navigationLocked) {
      var r = this.terria.scene,
        e = r.screenSpaceCameraController;
      if (!!e.enableInputs) {
        this.isActive = !0;
        var i = r.camera;
        if (Cesium.defined(this.terria.trackedEntity)) {
          var n = this.terria.trackedEntity;
          this.terria.trackedEntity = void 0, this.terria.trackedEntity = n
        } else if (this.terria.options.defaultResetView) {
          if (this.terria.options.defaultResetView && this.terria.options.defaultResetView instanceof Cesium.Cartographic) i.flyTo({
            destination: r.globe.ellipsoid.cartographicToCartesian(this.terria.options.defaultResetView)
          });
          else if (this.terria.options.defaultResetView && this.terria.options.defaultResetView instanceof Cesium.Rectangle) try {
            Cesium.Rectangle.validate(this.terria.options.defaultResetView), i.flyTo({
              destination: this.terria.options.defaultResetView,
              orientation: {
                heading: Cesium.Math.toRadians(5.729578)
              }
            })
          } catch {
            console.log("Cesium-navigation/ResetViewNavigationControl:   options.defaultResetView Cesium rectangle is  invalid!")
          }
        } else typeof i.flyHome == "function" ? i.flyHome(1) : i.flyTo({
          destination: Cesium.Camera.DEFAULT_VIEW_RECTANGLE,
          duration: 1
        });
        this.isActive = !1
      }
    }
  }, yi.prototype.activate = function () {
    this.resetView()
  };
  var vi = {},
    um = new Cesium.Cartographic,
    pn = new Cesium.Ray;
  vi.getCameraFocus = function (r, e, i) {
    var n = r.scene,
      s = n.camera;
    if (n.mode !== Cesium.SceneMode.MORPHING && (Cesium.defined(i) || (i = new Cesium.Cartesian3), Cesium.defined(r.trackedEntity) ? i = r.trackedEntity.position.getValue(r.clock.currentTime, i) : (pn.origin = s.positionWC, pn.direction = s.directionWC, i = n.globe.pick(pn, n, i)), !!Cesium.defined(i))) return n.mode === Cesium.SceneMode.SCENE2D || n.mode === Cesium.SceneMode.COLUMBUS_VIEW ? (i = s.worldToCameraCoordinatesPoint(i, i), e && (i = n.globe.ellipsoid.cartographicToCartesian(n.mapProjection.unproject(i, um), i))) : e || (i = s.worldToCameraCoordinatesPoint(i, i)), i
  };
  var Ht = function (r, e) {
    gi.apply(this, arguments), this.name = e ? r.options.zoomInTooltip ? r.options.zoomInTooltip : "\u653E\u5927" : r.options.zoomOutTooltip ? r.options.zoomOutTooltip : "\u7F29\u5C0F", e ? r.options.zoomInSvg ? this.zoomInSvg = r.options.zoomInSvg : this.text = "+" : r.options.zoomOutSvg ? this.zoomOutSvg = r.options.zoomOutSvg : this.text = "-", this.cssClass = "navigation-control-icon-zoom-" + (e ? "in" : "out"), this.relativeAmount = 2, e && (this.relativeAmount = 1 / this.relativeAmount)
  };
  Ht.prototype.relativeAmount = 1, Ht.prototype = Object.create(gi.prototype), Ht.prototype.activate = function () {
    this.zoom(this.relativeAmount)
  };
  var dm = new Cesium.Cartesian3;
  Ht.prototype.zoom = function (r) {
    if (this.isActive = !0, Cesium.defined(this.terria)) {
      var e = this.terria.scene,
        i = e.screenSpaceCameraController;
      if (!i.enableInputs || !i.enableZoom) return;
      var n = e.camera,
        s;
      switch (e.mode) {
        case Cesium.SceneMode.MORPHING:
          break;
        case Cesium.SceneMode.SCENE2D:
          n.zoomIn(n.positionCartographic.height * (1 - this.relativeAmount));
          break;
        default:
          var o;
          if (Cesium.defined(this.terria.trackedEntity) ? o = new Cesium.Cartesian3 : o = vi.getCameraFocus(this.terria, !1), Cesium.defined(o)) s = {
            direction: n.direction,
            up: n.up
          };
          else {
            var a = new Cesium.Ray(n.worldToCameraCoordinatesPoint(e.globe.ellipsoid.cartographicToCartesian(n.positionCartographic)), n.directionWC);
            o = Cesium.IntersectionTests.grazingAltitudeLocation(a, e.globe.ellipsoid), s = {
              heading: n.heading,
              pitch: n.pitch,
              roll: n.roll
            }
          }
          if (n.position.z >= 40694482871936856e-2) return;
          var c = Cesium.Cartesian3.subtract(n.position, o, dm),
            h = Cesium.Cartesian3.multiplyByScalar(c, r, c),
            u = Cesium.Cartesian3.add(o, h, o);
          Cesium.defined(this.terria.trackedEntity) || e.mode === Cesium.SceneMode.COLUMBUS_VIEW ? n.position = u : n.flyTo({
            destination: u,
            orientation: s,
            duration: .5,
            convert: !1
          })
      }
    }
    this.isActive = !1
  };
  var pm = "m 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z",
    fm = "m 72.71875,54.375 c -0.476702,0 -0.908208,0.245402 -1.21875,0.5625 -0.310542,0.317098 -0.551189,0.701933 -0.78125,1.1875 -0.172018,0.363062 -0.319101,0.791709 -0.46875,1.25 -6.91615,1.075544 -12.313231,6.656514 -13,13.625 -0.327516,0.117495 -0.661877,0.244642 -0.9375,0.375 -0.485434,0.22959 -0.901634,0.471239 -1.21875,0.78125 -0.317116,0.310011 -0.5625,0.742111 -0.5625,1.21875 l 0.03125,0 c 0,0.476639 0.245384,0.877489 0.5625,1.1875 0.317116,0.310011 0.702066,0.58291 1.1875,0.8125 0.35554,0.168155 0.771616,0.32165 1.21875,0.46875 1.370803,6.10004 6.420817,10.834127 12.71875,11.8125 0.146999,0.447079 0.30025,0.863113 0.46875,1.21875 0.230061,0.485567 0.470708,0.870402 0.78125,1.1875 0.310542,0.317098 0.742048,0.5625 1.21875,0.5625 0.476702,0 0.876958,-0.245402 1.1875,-0.5625 0.310542,-0.317098 0.582439,-0.701933 0.8125,-1.1875 0.172018,-0.363062 0.319101,-0.791709 0.46875,-1.25 6.249045,-1.017063 11.256351,-5.7184 12.625,-11.78125 0.447134,-0.1471 0.86321,-0.300595 1.21875,-0.46875 0.485434,-0.22959 0.901633,-0.502489 1.21875,-0.8125 0.317117,-0.310011 0.5625,-0.710861 0.5625,-1.1875 l -0.03125,0 c 0,-0.476639 -0.245383,-0.908739 -0.5625,-1.21875 C 89.901633,71.846239 89.516684,71.60459 89.03125,71.375 88.755626,71.244642 88.456123,71.117495 88.125,71 87.439949,64.078341 82.072807,58.503735 75.21875,57.375 c -0.15044,-0.461669 -0.326927,-0.884711 -0.5,-1.25 -0.230061,-0.485567 -0.501958,-0.870402 -0.8125,-1.1875 -0.310542,-0.317098 -0.710798,-0.5625 -1.1875,-0.5625 z m -0.0625,1.40625 c 0.03595,-0.01283 0.05968,0 0.0625,0 0.0056,0 0.04321,-0.02233 0.1875,0.125 0.144288,0.147334 0.34336,0.447188 0.53125,0.84375 0.06385,0.134761 0.123901,0.309578 0.1875,0.46875 -0.320353,-0.01957 -0.643524,-0.0625 -0.96875,-0.0625 -0.289073,0 -0.558569,0.04702 -0.84375,0.0625 C 71.8761,57.059578 71.936151,56.884761 72,56.75 c 0.18789,-0.396562 0.355712,-0.696416 0.5,-0.84375 0.07214,-0.07367 0.120304,-0.112167 0.15625,-0.125 z m 0,2.40625 c 0.448007,0 0.906196,0.05436 1.34375,0.09375 0.177011,0.592256 0.347655,1.271044 0.5,2.03125 0.475097,2.370753 0.807525,5.463852 0.9375,8.9375 -0.906869,-0.02852 -1.834463,-0.0625 -2.78125,-0.0625 -0.92298,0 -1.802327,0.03537 -2.6875,0.0625 0.138529,-3.473648 0.493653,-6.566747 0.96875,-8.9375 0.154684,-0.771878 0.320019,-1.463985 0.5,-2.0625 0.405568,-0.03377 0.804291,-0.0625 1.21875,-0.0625 z m -2.71875,0.28125 c -0.129732,0.498888 -0.259782,0.987558 -0.375,1.5625 -0.498513,2.487595 -0.838088,5.693299 -0.96875,9.25 -3.21363,0.15162 -6.119596,0.480068 -8.40625,0.9375 -0.682394,0.136509 -1.275579,0.279657 -1.84375,0.4375 0.799068,-6.135482 5.504716,-11.036454 11.59375,-12.1875 z M 75.5,58.5 c 6.043169,1.18408 10.705093,6.052712 11.5,12.15625 -0.569435,-0.155806 -1.200273,-0.302525 -1.875,-0.4375 -2.262525,-0.452605 -5.108535,-0.783809 -8.28125,-0.9375 -0.130662,-3.556701 -0.470237,-6.762405 -0.96875,-9.25 C 75.761959,59.467174 75.626981,58.990925 75.5,58.5 z m -2.84375,12.09375 c 0.959338,0 1.895843,0.03282 2.8125,0.0625 C 75.48165,71.267751 75.5,71.871028 75.5,72.5 c 0,1.228616 -0.01449,2.438313 -0.0625,3.59375 -0.897358,0.0284 -1.811972,0.0625 -2.75,0.0625 -0.927373,0 -1.831062,-0.03473 -2.71875,-0.0625 -0.05109,-1.155437 -0.0625,-2.365134 -0.0625,-3.59375 0,-0.628972 0.01741,-1.232249 0.03125,-1.84375 0.895269,-0.02827 1.783025,-0.0625 2.71875,-0.0625 z M 68.5625,70.6875 c -0.01243,0.60601 -0.03125,1.189946 -0.03125,1.8125 0,1.22431 0.01541,2.407837 0.0625,3.5625 -3.125243,-0.150329 -5.92077,-0.471558 -8.09375,-0.90625 -0.784983,-0.157031 -1.511491,-0.316471 -2.125,-0.5 -0.107878,-0.704096 -0.1875,-1.422089 -0.1875,-2.15625 0,-0.115714 0.02849,-0.228688 0.03125,-0.34375 0.643106,-0.20284 1.389577,-0.390377 2.25,-0.5625 2.166953,-0.433487 4.97905,-0.75541 8.09375,-0.90625 z m 8.3125,0.03125 c 3.075121,0.15271 5.824455,0.446046 7.96875,0.875 0.857478,0.171534 1.630962,0.360416 2.28125,0.5625 0.0027,0.114659 0,0.228443 0,0.34375 0,0.735827 -0.07914,1.450633 -0.1875,2.15625 -0.598568,0.180148 -1.29077,0.34562 -2.0625,0.5 -2.158064,0.431708 -4.932088,0.754666 -8.03125,0.90625 0.04709,-1.154663 0.0625,-2.33819 0.0625,-3.5625 0,-0.611824 -0.01924,-1.185379 -0.03125,-1.78125 z M 57.15625,72.5625 c 0.0023,0.572772 0.06082,1.131112 0.125,1.6875 -0.125327,-0.05123 -0.266577,-0.10497 -0.375,-0.15625 -0.396499,-0.187528 -0.665288,-0.387337 -0.8125,-0.53125 -0.147212,-0.143913 -0.15625,-0.182756 -0.15625,-0.1875 0,-0.0047 -0.02221,-0.07484 0.125,-0.21875 0.147212,-0.143913 0.447251,-0.312472 0.84375,-0.5 0.07123,-0.03369 0.171867,-0.06006 0.25,-0.09375 z m 31.03125,0 c 0.08201,0.03503 0.175941,0.05872 0.25,0.09375 0.396499,0.187528 0.665288,0.356087 0.8125,0.5 0.14725,0.14391 0.15625,0.21405 0.15625,0.21875 0,0.0047 -0.009,0.04359 -0.15625,0.1875 -0.147212,0.143913 -0.416001,0.343722 -0.8125,0.53125 -0.09755,0.04613 -0.233314,0.07889 -0.34375,0.125 0.06214,-0.546289 0.09144,-1.094215 0.09375,-1.65625 z m -29.5,3.625 c 0.479308,0.123125 0.983064,0.234089 1.53125,0.34375 2.301781,0.460458 5.229421,0.787224 8.46875,0.9375 0.167006,2.84339 0.46081,5.433176 0.875,7.5 0.115218,0.574942 0.245268,1.063612 0.375,1.5625 -5.463677,-1.028179 -9.833074,-5.091831 -11.25,-10.34375 z m 27.96875,0 C 85.247546,81.408945 80.919274,85.442932 75.5,86.5 c 0.126981,-0.490925 0.261959,-0.967174 0.375,-1.53125 0.41419,-2.066824 0.707994,-4.65661 0.875,-7.5 3.204493,-0.15162 6.088346,-0.480068 8.375,-0.9375 0.548186,-0.109661 1.051942,-0.220625 1.53125,-0.34375 z M 70.0625,77.53125 c 0.865391,0.02589 1.723666,0.03125 2.625,0.03125 0.912062,0 1.782843,-0.0048 2.65625,-0.03125 -0.165173,2.736408 -0.453252,5.207651 -0.84375,7.15625 -0.152345,0.760206 -0.322989,1.438994 -0.5,2.03125 -0.437447,0.03919 -0.895856,0.0625 -1.34375,0.0625 -0.414943,0 -0.812719,-0.02881 -1.21875,-0.0625 -0.177011,-0.592256 -0.347655,-1.271044 -0.5,-2.03125 -0.390498,-1.948599 -0.700644,-4.419842 -0.875,-7.15625 z m 1.75,10.28125 c 0.284911,0.01545 0.554954,0.03125 0.84375,0.03125 0.325029,0 0.648588,-0.01171 0.96875,-0.03125 -0.05999,0.148763 -0.127309,0.31046 -0.1875,0.4375 -0.18789,0.396562 -0.386962,0.696416 -0.53125,0.84375 -0.144288,0.147334 -0.181857,0.125 -0.1875,0.125 -0.0056,0 -0.07446,0.02233 -0.21875,-0.125 C 72.355712,88.946416 72.18789,88.646562 72,88.25 71.939809,88.12296 71.872486,87.961263 71.8125,87.8125 z",
    mm = "M 72.46875,22.03125 C 59.505873,22.050338 46.521615,27.004287 36.6875,36.875 L 47.84375,47.96875 C 61.521556,34.240041 83.442603,34.227389 97.125,47.90625 l 11.125,-11.125 C 98.401629,26.935424 85.431627,22.012162 72.46875,22.03125 z",
    gm = Cesium.knockout,
    Ee = function (r) {
      this.terria = r.terria, this.eventHelper = new Cesium.EventHelper, this.enableZoomControls = Cesium.defined(r.enableZoomControls) ? r.enableZoomControls : !0, this.enableCompass = Cesium.defined(r.enableCompass) ? r.enableCompass : !0, this.navigationLocked = !1, this.controls = r.controls, Cesium.defined(this.controls) || (this.controls = [new Ht(this.terria, !0), new yi(this.terria), new Ht(this.terria, !1)]), this.svgCompassOuterRing = pm, this.svgCompassGyro = fm, this.svgCompassRotationMarker = mm, this.showCompass = Cesium.defined(this.terria) && this.enableCompass, this.heading = this.showCompass ? this.terria.scene.camera.heading : 0, this.isOrbiting = !1, this.orbitCursorAngle = 0, this.orbitCursorOpacity = 0, this.orbitLastTimestamp = 0, this.orbitFrame = void 0, this.orbitIsLook = !1, this.orbitMouseMoveFunction = void 0, this.orbitMouseUpFunction = void 0, this.isRotating = !1, this.rotateInitialCursorAngle = void 0, this.rotateFrame = void 0, this.rotateIsLook = !1, this.rotateMouseMoveFunction = void 0, this.rotateMouseUpFunction = void 0, this._unsubcribeFromPostRender = void 0, gm.track(this, ["controls", "showCompass", "heading", "isOrbiting", "orbitCursorAngle", "isRotating"]);
      var e = this;
      Ee.prototype.setNavigationLocked = function (n) {
        this.navigationLocked = n, this.controls && this.controls.length > 1 && this.controls[1].setNavigationLocked(this.navigationLocked)
      };

      function i() {
        Cesium.defined(e.terria) ? (e._unsubcribeFromPostRender && (e._unsubcribeFromPostRender(), e._unsubcribeFromPostRender = void 0), e.showCompass = e.enableCompass, e._unsubcribeFromPostRender = e.terria.scene.postRender.addEventListener(function () {
          e.heading = e.terria.scene.camera.heading
        })) : (e._unsubcribeFromPostRender && (e._unsubcribeFromPostRender(), e._unsubcribeFromPostRender = void 0), e.showCompass = !1)
      }
      this.eventHelper.add(this.terria.afterWidgetChanged, i, this), i()
    };
  Ee.prototype.destroy = function () {
    this.eventHelper.removeAll()
  }, Ee.prototype.show = function (r) {
    const e = "</div>",
      i = ">",
      n = ' style="display: none;"',
      s = '<div class="compass"',
      o = 'title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown,touchstart:handleMouseDown, dblclick: handleDoubleClick }">',
      a = '<div class="compass-outer-ring-background"></div>',
      c = ` <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }`,
      h = c + ', cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"' + i,
      u = c + '"' + i + this.terria.options.compassRotationMarkerSvg,
      d = (this.terria.options.compassRotationMarkerSvg ? u : h) + e,
      p = ` <div class="compass-outer-ring" title="" data-bind="style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }`,
      f = p + ', cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"' + i,
      m = p + '"' + i + this.terria.options.compassOuterRingSvg,
      g = (this.terria.options.compassOuterRingSvg ? m : f) + e,
      y = ' <div class="compass-gyro-background"></div>',
      x = ` <div class="compass-gyro" data-bind="css: { 'compass-gyro-active': isOrbiting }`,
      A = x + ',cesiumSvgPath: { path: svgCompassGyro, width: 145, height: 145 } "' + i,
      _ = x + '"' + i + this.terria.options.compassGyroSvg,
      v = (this.terria.options.compassGyroSvg ? _ : A) + e,
      b = o + a + d + g + y + v + e,
      C = s + b,
      M = s + n + b,
      S = '<div class="navigation-controls"',
      H = this.terria.options.resetSvg,
      N = this.terria.options.zoomInSvg,
      w = this.terria.options.zoomOutSvg,
      E = i + `<!-- ko foreach: controls --><div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' ">   <!-- ko if: $data.hasText -->   <div data-bind="text: $data.text, css: $data.isActive ?  'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div>   <!-- /ko -->  <!-- ko ifnot: $data.hasText -->  <!-- ko if: $data.svgIcon -->  <div data-bind="cesiumSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ?  'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div>  <!-- /ko -->  <!-- ko ifnot: $data.svgIcon -->  <!-- ko if: $data.resetSvg -->  <div class="navigation-control-icon-svg">` + H + '</div>  <!-- /ko -->  <!-- ko ifnot: $data.resetSvg -->  <!-- ko if: $data.zoomInSvg -->  <div class="navigation-control-icon-svg">' + N + '</div>  <!-- /ko -->  <!-- ko ifnot: $data.zoomInSvg -->  <!-- ko if: $data.zoomOutSvg -->  <div class="navigation-control-icon-svg">' + w + "</div>  <!-- /ko -->  <!-- /ko -->  <!-- /ko -->  <!-- /ko -->  <!-- /ko --> </div> <!-- /ko -->" + e,
      B = S + E,
      T = S + n + i + E,
      D = (this.enableCompass ? C : M) + (this.enableZoomControls ? B : T);
    Va(D, r, this)
  }, Ee.prototype.add = function (r) {
    this.controls.push(r)
  }, Ee.prototype.remove = function (r) {
    this.controls.remove(r)
  }, Ee.prototype.isLastControl = function (r) {
    return r === this.controls[this.controls.length - 1]
  };
  var fn = new Cesium.Cartesian2;
  const mn = r => {
    let e;
    r.touches ? e = r.touches[0] : e = r;
    const {
      clientX: i,
      clientY: n
    } = e;
    return {
      clientX: i,
      clientY: n
    }
  };
  Ee.prototype.handleMouseDown = function (r, e) {
    const {
      clientX: i,
      clientY: n
    } = mn(e);
    var s = this.terria.scene;
    if (s.mode === Cesium.SceneMode.MORPHING || r.navigationLocked) return !0;
    var o = e.currentTarget,
      a = e.currentTarget.getBoundingClientRect(),
      c = a.width / 2,
      h = new Cesium.Cartesian2((a.right - a.left) / 2, (a.bottom - a.top) / 2),
      u = new Cesium.Cartesian2(i - a.left, n - a.top),
      d = Cesium.Cartesian2.subtract(u, h, fn),
      p = Cesium.Cartesian2.magnitude(d),
      f = p / c,
      m = 145,
      g = 50;
    if (f < g / m) _m(this, o, d);
    else if (f < 1) wm(this, o, d);
    else return !0
  };
  var gn = new Cesium.Matrix4,
    $i = new Cesium.Matrix4,
    yn = new Cesium.Cartesian3;
  Ee.prototype.handleDoubleClick = function (r, e) {
    var i = r.terria.scene,
      n = i.camera,
      s = i.screenSpaceCameraController;
    if (i.mode === Cesium.SceneMode.MORPHING || !s.enableInputs || r.navigationLocked) return !0;
    if (!(i.mode === Cesium.SceneMode.COLUMBUS_VIEW && !s.enableTranslate) && !((i.mode === Cesium.SceneMode.SCENE3D || i.mode === Cesium.SceneMode.COLUMBUS_VIEW) && (!s.enableLook || i.mode === Cesium.SceneMode.SCENE3D && !s.enableRotate))) {
      var o = vi.getCameraFocus(r.terria, !0, yn);
      if (!Cesium.defined(o)) {
        this.controls[1].resetView();
        return
      }
      var a = i.globe.ellipsoid.cartographicToCartesian(n.positionCartographic, new Cesium.Cartesian3),
        c = i.globe.ellipsoid.geodeticSurfaceNormal(o),
        h = new Cesium.BoundingSphere(o, 0);
      n.flyToBoundingSphere(h, {
        offset: new Cesium.HeadingPitchRange(0, Cesium.Math.PI_OVER_TWO - Cesium.Cartesian3.angleBetween(c, n.directionWC), Cesium.Cartesian3.distance(a, o)),
        duration: 1.5
      })
    }
  }, Ee.create = function (r) {
    var e = new Ee(r);
    return e.show(r.container), e
  };
  const ym = r => {
      document.addEventListener("mousemove", r.orbitMouseMoveFunction, !1), document.addEventListener("touchmove", r.orbitMouseMoveFunction, !1), document.addEventListener("mouseup", r.orbitMouseUpFunction, !1), document.addEventListener("touchend", r.orbitMouseUpFunction, !1)
    },
    vm = r => {
      document.addEventListener("mousemove", r.rotateMouseMoveFunction, !1), document.addEventListener("touchmove", r.rotateMouseMoveFunction, !1), document.addEventListener("mouseup", r.rotateMouseUpFunction, !1), document.addEventListener("touchend", r.rotateMouseUpFunction, !1)
    },
    ja = r => {
      document.removeEventListener("mousemove", r.orbitMouseMoveFunction, !1), document.removeEventListener("touchmove", r.orbitMouseMoveFunction, !1), document.removeEventListener("mouseup", r.orbitMouseUpFunction, !1), document.removeEventListener("touchend", r.orbitMouseUpFunction, !1)
    },
    qa = r => {
      document.removeEventListener("mousemove", r.rotateMouseMoveFunction, !1), document.removeEventListener("touchmove", r.rotateMouseMoveFunction, !1), document.removeEventListener("mouseup", r.rotateMouseUpFunction, !1), document.removeEventListener("touchend", r.rotateMouseUpFunction, !1)
    };

  function _m(r, e, i) {
    var n = r.terria.scene,
      s = n.screenSpaceCameraController;
    if (n.mode === Cesium.SceneMode.MORPHING || !s.enableInputs) return;
    if (r.navigationLocked) return !0;
    switch (n.mode) {
      case Cesium.SceneMode.COLUMBUS_VIEW:
        if (s.enableLook) break;
        if (!s.enableTranslate || !s.enableTilt) return;
        break;
      case Cesium.SceneMode.SCENE3D:
        if (s.enableLook) break;
        if (!s.enableTilt || !s.enableRotate) return;
        break;
      case Cesium.SceneMode.SCENE2D:
        if (!s.enableTranslate) return;
        break
    }
    ja(r), Cesium.defined(r.orbitTickFunction) && r.terria.clock.onTick.removeEventListener(r.orbitTickFunction), r.orbitMouseMoveFunction = void 0, r.orbitMouseUpFunction = void 0, r.orbitTickFunction = void 0, r.isOrbiting = !0, r.orbitLastTimestamp = Cesium.getTimestamp();
    var o = n.camera;
    if (Cesium.defined(r.terria.trackedEntity)) r.orbitFrame = void 0, r.orbitIsLook = !1;
    else {
      var a = vi.getCameraFocus(r.terria, !0, yn);
      Cesium.defined(a) ? (r.orbitFrame = Cesium.Transforms.eastNorthUpToFixedFrame(a, n.globe.ellipsoid, $i), r.orbitIsLook = !1) : (r.orbitFrame = Cesium.Transforms.eastNorthUpToFixedFrame(o.positionWC, n.globe.ellipsoid, $i), r.orbitIsLook = !0)
    }
    r.orbitTickFunction = function (h) {
      var u = Cesium.getTimestamp(),
        d = u - r.orbitLastTimestamp,
        p = (r.orbitCursorOpacity - .5) * 2.5 / 1e3,
        f = d * p,
        m = r.orbitCursorAngle + Cesium.Math.PI_OVER_TWO,
        g = Math.cos(m) * f,
        y = Math.sin(m) * f,
        x;
      if (r.navigationLocked) return !0;
      Cesium.defined(r.orbitFrame) && (x = Cesium.Matrix4.clone(o.transform, gn), o.lookAtTransform(r.orbitFrame)), n.mode === Cesium.SceneMode.SCENE2D ? o.move(new Cesium.Cartesian3(g, y, 0), Math.max(n.canvas.clientWidth, n.canvas.clientHeight) / 100 * o.positionCartographic.height * f) : r.orbitIsLook ? (o.look(Cesium.Cartesian3.UNIT_Z, -g), o.look(o.right, -y)) : (o.rotateLeft(g), o.rotateUp(y)), Cesium.defined(r.orbitFrame) && o.lookAtTransform(x), r.orbitLastTimestamp = u
    };

    function c(h, u) {
      var d = Math.atan2(-h.y, h.x);
      r.orbitCursorAngle = Cesium.Math.zeroToTwoPi(d - Cesium.Math.PI_OVER_TWO);
      var p = Cesium.Cartesian2.magnitude(h),
        f = u / 2,
        m = Math.min(p / f, 1),
        g = .5 * m * m + .5;
      r.orbitCursorOpacity = g
    }
    r.orbitMouseMoveFunction = function (h) {
      const {
        clientX: u,
        clientY: d
      } = mn(h);
      var p = e.getBoundingClientRect(),
        f = new Cesium.Cartesian2((p.right - p.left) / 2, (p.bottom - p.top) / 2),
        m = new Cesium.Cartesian2(u - p.left, d - p.top),
        g = Cesium.Cartesian2.subtract(m, f, fn);
      c(g, p.width)
    }, r.orbitMouseUpFunction = function (h) {
      r.isOrbiting = !1, ja(r), Cesium.defined(r.orbitTickFunction) && r.terria.clock.onTick.removeEventListener(r.orbitTickFunction), r.orbitMouseMoveFunction = void 0, r.orbitMouseUpFunction = void 0, r.orbitTickFunction = void 0
    }, ym(r), r.terria.clock.onTick.addEventListener(r.orbitTickFunction), c(i, e.getBoundingClientRect().width)
  }

  function wm(r, e, i) {
    var n = r.terria.scene,
      s = n.camera,
      o = n.screenSpaceCameraController;
    if (!(n.mode === Cesium.SceneMode.MORPHING || n.mode === Cesium.SceneMode.SCENE2D || !o.enableInputs)) {
      if (r.navigationLocked) return !0;
      if (!(!o.enableLook && (n.mode === Cesium.SceneMode.COLUMBUS_VIEW || n.mode === Cesium.SceneMode.SCENE3D && !o.enableRotate))) {
        if (qa(r), r.rotateMouseMoveFunction = void 0, r.rotateMouseUpFunction = void 0, r.isRotating = !0, r.rotateInitialCursorAngle = Math.atan2(-i.y, i.x), Cesium.defined(r.terria.trackedEntity)) r.rotateFrame = void 0, r.rotateIsLook = !1;
        else {
          var a = vi.getCameraFocus(r.terria, !0, yn);
          !Cesium.defined(a) || n.mode === Cesium.SceneMode.COLUMBUS_VIEW && !o.enableLook && !o.enableTranslate ? (r.rotateFrame = Cesium.Transforms.eastNorthUpToFixedFrame(s.positionWC, n.globe.ellipsoid, $i), r.rotateIsLook = !0) : (r.rotateFrame = Cesium.Transforms.eastNorthUpToFixedFrame(a, n.globe.ellipsoid, $i), r.rotateIsLook = !1)
        }
        var c;
        Cesium.defined(r.rotateFrame) && (c = Cesium.Matrix4.clone(s.transform, gn), s.lookAtTransform(r.rotateFrame)), r.rotateInitialCameraAngle = -s.heading, Cesium.defined(r.rotateFrame) && s.lookAtTransform(c), r.rotateMouseMoveFunction = function (h) {
          const {
            clientX: u,
            clientY: d
          } = mn(h);
          var p = e.getBoundingClientRect(),
            f = new Cesium.Cartesian2((p.right - p.left) / 2, (p.bottom - p.top) / 2),
            m = new Cesium.Cartesian2(u - p.left, d - p.top),
            g = Cesium.Cartesian2.subtract(m, f, fn),
            y = Math.atan2(-g.y, g.x),
            x = y - r.rotateInitialCursorAngle,
            A = Cesium.Math.zeroToTwoPi(r.rotateInitialCameraAngle - x),
            _ = r.terria.scene.camera,
            v;
          Cesium.defined(r.rotateFrame) && (v = Cesium.Matrix4.clone(_.transform, gn), _.lookAtTransform(r.rotateFrame));
          var b = -_.heading;
          _.rotateRight(A - b), Cesium.defined(r.rotateFrame) && _.lookAtTransform(v)
        }, r.rotateMouseUpFunction = function (h) {
          r.isRotating = !1, qa(r), r.rotateMouseMoveFunction = void 0, r.rotateMouseUpFunction = void 0
        }, vm(r)
      }
    }
  }
  var Qa = Cesium.Event,
    De = function (r) {
      Cm.apply(this, arguments), this._onDestroyListeners = []
    };
  De.prototype.distanceLegendViewModel = void 0, De.prototype.navigationViewModel = void 0, De.prototype.navigationDiv = void 0, De.prototype.distanceLegendDiv = void 0, De.prototype.terria = void 0, De.prototype.container = void 0, De.prototype._onDestroyListeners = void 0, De.prototype._navigationLocked = !1, De.prototype.setNavigationLocked = function (r) {
    this._navigationLocked = r, this.navigationViewModel.setNavigationLocked(this._navigationLocked)
  }, De.prototype.getNavigationLocked = function () {
    return this._navigationLocked
  }, De.prototype.destroy = function () {
    Cesium.defined(this.navigationViewModel) && this.navigationViewModel.destroy(), Cesium.defined(this.distanceLegendViewModel) && this.distanceLegendViewModel.destroy(), Cesium.defined(this.navigationDiv) && this.navigationDiv.parentNode.removeChild(this.navigationDiv), delete this.navigationDiv, Cesium.defined(this.distanceLegendDiv) && this.distanceLegendDiv.parentNode.removeChild(this.distanceLegendDiv), delete this.distanceLegendDiv, Cesium.defined(this.container) && this.container.parentNode.removeChild(this.container), delete this.container;
    for (var r = 0; r < this._onDestroyListeners.length; r++) this._onDestroyListeners[r]()
  }, De.prototype.addOnDestroyListener = function (r) {
    typeof r == "function" && this._onDestroyListeners.push(r)
  };

  function Cm(r, e) {
    if (!Cesium.defined(r)) throw new Cesium.DeveloperError("CesiumWidget or Viewer is required.");
    var i = Cesium.defined(r.cesiumWidget) ? r.cesiumWidget : r,
      n = document.createElement("div");
    n.className = "cesium-widget-cesiumNavigationContainer", i.container.appendChild(n), this.terria = r, this.terria.options = Cesium.defined(e) ? e : {}, this.terria.afterWidgetChanged = new Qa, this.terria.beforeWidgetChanged = new Qa, this.container = n, (!Cesium.defined(this.terria.options.enableDistanceLegend) || this.terria.options.enableDistanceLegend) && (this.distanceLegendDiv = document.createElement("div"), n.appendChild(this.distanceLegendDiv), this.distanceLegendDiv.setAttribute("id", "distanceLegendDiv"), this.distanceLegendViewModel = mi.create({
      container: this.distanceLegendDiv,
      terria: this.terria,
      mapElement: n,
      enableDistanceLegend: !0
    })), (!Cesium.defined(this.terria.options.enableZoomControls) || this.terria.options.enableZoomControls) && (!Cesium.defined(this.terria.options.enableCompass) || this.terria.options.enableCompass) ? (this.navigationDiv = document.createElement("div"), this.navigationDiv.setAttribute("id", "navigationDiv"), n.appendChild(this.navigationDiv), this.navigationViewModel = Ee.create({
      container: this.navigationDiv,
      terria: this.terria,
      enableZoomControls: !0,
      enableCompass: !0
    })) : Cesium.defined(this.terria.options.enableZoomControls) && !this.terria.options.enableZoomControls && (!Cesium.defined(this.terria.options.enableCompass) || this.terria.options.enableCompass) ? (this.navigationDiv = document.createElement("div"), this.navigationDiv.setAttribute("id", "navigationDiv"), n.appendChild(this.navigationDiv), this.navigationViewModel = Ee.create({
      container: this.navigationDiv,
      terria: this.terria,
      enableZoomControls: !1,
      enableCompass: !0
    })) : (!Cesium.defined(this.terria.options.enableZoomControls) || this.terria.options.enableZoomControls) && Cesium.defined(this.terria.options.enableCompass) && !this.terria.options.enableCompass ? (this.navigationDiv = document.createElement("div"), this.navigationDiv.setAttribute("id", "navigationDiv"), n.appendChild(this.navigationDiv), this.navigationViewModel = Ee.create({
      container: this.navigationDiv,
      terria: this.terria,
      enableZoomControls: !0,
      enableCompass: !1
    })) : Cesium.defined(this.terria.options.enableZoomControls) && !this.terria.options.enableZoomControls && Cesium.defined(this.terria.options.enableCompass) && !this.terria.options.enableCompass
  }
  var i0 = "";
  class Ya extends Gt {
    _addedHook() {
      this._init()
    }
    _init() {
      if (!this._map) return;
      const e = this._map,
        a = this.options,
        {
          compass: i = !0,
          distance: n = !0,
          zoom: s = !0
        } = a,
        o = re(a, ["compass", "distance", "zoom"]);
      this.node = new De(e.viewer, j({
        enableCompass: i,
        enableZoomControls: s,
        enableDistanceLegend: n
      }, o)), ge(i) && pe(this.node.container.querySelector(".compass"), i), ge(s) && pe(this.node.container.querySelector(".navigation-controls"), s), ge(n) && pe(this.node.container.querySelector(".distance-legend"), n)
    }
    setOptions(e) {
      var i;
      this.node && ((i = this.node) == null || i.destroy(), this.node = null), this.options = ye(this.options, e), this._init()
    }
    destroy() {
      var e;
      (e = this.node) == null || e.destroy(), this.node = null, super.destroy()
    }
  }
  var r0 = "";
  class Xa extends Gt {
    _addedHook() {
      this._init()
    }
    _init() {
      this._dom = Gp("div", {
        className: "location-bar-box",
        container: this._map.container
      });
      const e = () => {
        const {
          center: i,
          distance: n,
          rotate: s,
          tilt: o
        } = this._map.getCurrentView() || {};
        if (!i || i.isZero()) return;
        const {
          lng: a,
          lat: c,
          alt: h
        } = i.toLatLng();
        if (this.options.templateCallback) {
          this._dom.innerHTML = this.options.templateCallback({
            center: i,
            distance: n,
            rotate: s,
            tilt: o
          });
          return
        }
        this._dom.innerHTML = `
                <span>\u7ECF\u5EA6: ${+a.toFixed(6)}\xB0</span>
                <span>\u7EAC\u5EA6: ${+c.toFixed(6)}\xB0</span>
                <span>\u6D77\u62D4: ${+h.toFixed(0)}\u7C73</span>
                <span>\u65B9\u5411: ${+s.toFixed(0)}\xB0</span>
                <span>\u503E\u659C\u89D2: ${+o.toFixed(0)}\xB0</span>
                <span>\u89C6\u8DDD: ${+n.toFixed(0)}\u7C73</span>
            `
      };
      this._eventEffect = this._map.on([K.CameraChanged, K.CameraMoveEnd].join(" "), e), e()
    }
    setOptions(e) {
      this._dom && (this._dom.remove(), this._dom = null), this._eventEffect && (this._eventEffect(), this._eventEffect = null), this.options = ye(this.options, e), this._init()
    }
    destroy() {
      this._dom && (this._dom.remove(), this._dom = null), this._eventEffect && (this._eventEffect(), this._eventEffect = null), super.destroy()
    }
  }
  var n0 = "";
  class Ka extends Gt {
    constructor(e) {
      super(ne({
        mapOptions: {
          scene: {
            screenSpaceCameraController: {
              enableRotate: !1,
              enableTranslate: !1,
              enableZoom: !1,
              enableTilt: !1,
              enableLook: !1
            }
          }
        },
        rectangleStyle: {
          color: "rgb(243, 131, 33)"
        },
        scale: 1.2
      }, e))
    }
    _addedHook() {
      const e = this._map;
      this._div = document.createElement("div"), this._div.setAttribute("class", "cesium-view-control-overview"), e.container.append(this._div), this.overviewMap = new ll(this._div, j({
        baseMaps: e.options.baseMaps,
        imageryProvider: e.options.imageryProvider
      }, this.options.mapOptions)), this.overviewMap.changeMode("2d"), this.overviewMap.viewer.entities.add({
        rectangle: {
          coordinates: new l.CallbackProperty(() => {
            const n = e.viewer.camera.computeViewRectangle();
            if (!n) return;
            const s = l.BoundingSphere.fromRectangle3D(n);
            return s.radius *= this.options.scale, this.overviewMap.camera.viewBoundingSphere(s), n
          }, !1),
          outline: !0,
          outlineColor: l.Color.fromCssColorString(this.options.rectangleStyle.color),
          extrudedHeight: 1,
          height: 1,
          material: l.Color.fromCssColorString(this.options.rectangleStyle.color).withAlpha(.1)
        }
      })
    }
    destroy() {
      this._div && (this._map.container.removeChild(this._div), this._div = null), this.overviewMap && (this.overviewMap.destroy(), this.overviewMap = null), super.destroy()
    }
  }
  const Ja = {
    [jt.Floor]: Ua,
    [jt.Navigation]: Ya,
    [jt.LocationBar]: Xa,
    [jt.Overview]: Ka
  };
  var xm = Object.freeze({
      __proto__: null,
      [Symbol.toStringTag]: "Module",
      ControlMap: Ja,
      FloorControl: Ua,
      NavigationControl: Ya,
      LocationBarControl: Xa,
      OverviewControl: Ka
    }),
    bm = {
      _extendInit() {
        this.controls = []
      },
      setControlOptions(r) {
        Object.entries(r).forEach(([e, i]) => {
          if (i === !1 || i.show === !1) {
            this.removeControl(e);
            return
          }
          this.getControl(e) ? this.updateControl(j({
            id: e
          }, i)) : this.addControl(j({
            id: e,
            type: e
          }, i))
        })
      },
      updateControl(i) {
        var n = i,
          {
            id: r
          } = n,
          e = re(n, ["id"]);
        const s = this.getControl(r);
        !s || s.setOptions(e)
      },
      addControl(r) {
        let e;
        if (r instanceof Gt) e = r;
        else {
          const i = r,
            {
              type: n
            } = i,
            s = re(i, ["type"]),
            o = Ja[n];
          if (!o) return;
          e = new o(se(j({}, s), {
            map: this
          }))
        }
        return e._onAddToMap(this), this.controls.push(e), e
      },
      getControl(r) {
        return r instanceof Gt ? r : this.controls.find(e => e.id === r)
      },
      removeControl(r) {
        const e = this.getControl(r),
          i = this.controls.findIndex(n => n === e);
        i !== -1 && (this.controls.splice(i, 1), e.state !== me.DESTROYED && e.destroy())
      }
    };
  class Le {
    constructor(e) {
      this.id = e.id || Kt(), this.state = me.INITIALIZED, this.setOptions(j({
        show: !0
      }, e))
    }
    setOptions(e) {
      ge(e) && Object.entries(e).forEach(([i, n]) => {
        i === "show" ? this.enable = n : this[i] = n
      })
    }
    destroy() {
      this.enable = !1, this._delegate && (this._delegate = null), this.state = me.DESTROYED, this._map.removeEffect(this), this._map = null, this._viewer = null
    }
    show() {
      this.enable = !0
    }
    hide() {
      this.enable = !1
    }
    addTo(e) {
      return e ? (this._map = e, this._viewer = e.viewer, this.state = me.ADDED, this.enable && this.show(), this) : this
    }
  }
  const Am = new URL("", self.location).href,
    Pm = {
      speed: .1,
      heading: 0
    };
  class Sm extends Le {
    constructor(e = {}) {
      super(ye(Pm, e));
      this._delegate = void 0, this.type = he.Cloud
    }
    set enable(e) {
      this._enable = e, this._delegate && (this._delegate.show = e), !!this._map && !this._map.viewer.scene.mode !== l.SceneMode.SCENE3D && (this._enable ? this._cancel || (this._cancel = this._map.viewer.scene.postUpdate.addEventListener(this._onRotate, this)) : this._cancel && (this._cancel(), this._cancel = null))
    }
    get enable() {
      return this._enable
    }
    set speed(e) {
      this._speed = e
    }
    get speed() {
      return this._speed
    }
    set heading(e) {
      this._heading = e
    }
    get heading() {
      return this._heading
    }
    _onRotate(e, i) {
      this._speed !== 0 && (this._heading += this._speed, (this._heading >= 360 || this._heading <= -360) && (this._heading = 0), this._delegate.modelMatrix = l.Transforms.headingPitchRollToFixedFrame(new l.Cartesian3, new l.HeadingPitchRoll(l.Math.toRadians(this._heading), 0, 0)))
    }
    _createPrimitive() {
      this._delegate = new l.Primitive({
        appearance: new l.EllipsoidSurfaceAppearance({
          translucent: !0,
          aboveGround: !0,
          material: new l.Material({
            fabric: {
              type: "Image",
              uniforms: {
                color: new l.Color(1, 1, 1, 1),
                image: Am
              },
              components: {
                alpha: `
                            #if __VERSION__ == 300
                                #define TEXTURE_FUNC texture
                            #else
                                #define TEXTURE_FUNC texture2D
                            #endif
                            TEXTURE_FUNC(image, fract(repeat * materialInput.st)).r * color.a`,
                diffuse: "vec3(1.0)"
              }
            }
          })
        })
      }), this._delegate.geometryInstances = new l.GeometryInstance({
        geometry: new l.EllipsoidGeometry({
          vertexFormat: l.VertexFormat.POSITION_AND_ST,
          radii: this._map.viewer.scene.globe.ellipsoid.radii
        }),
        id: this.id
      }), this._delegate.show = this._enable, this._map.viewer.scene.primitives.add(this._delegate)
    }
    addTo(e) {
      if (!e) return this;
      this._map = e, this._createPrimitive(), this.state = me.ADDED, this.enable && this.show()
    }
  }
  var Tm = `
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform vec4 fogByDistance;
uniform vec4 fogColor;

#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
  in vec2 v_textureCoordinates;
  out vec4 fragColor;
#else
  #define TEXTURE_FUNC texture2D
  varying vec2 v_textureCoordinates;
#endif


float getDistance(sampler2D depthTexture, vec2 texCoords){
  float depth = czm_unpackDepth(TEXTURE_FUNC(depthTexture, texCoords));
  if (depth == 0.0) {
    return czm_infinity;
  }
  vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);
  return -eyeCoordinate.z / eyeCoordinate.w;
}


float interpolateByDistance(vec4 nearFarScalar, float distance){
  float startDistance = nearFarScalar.x;
  float startValue = nearFarScalar.y;
  float endDistance = nearFarScalar.z;
  float endValue = nearFarScalar.w;
  float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
  return mix(startValue, endValue, t);
}

vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor){
  return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}

void main(void){
  float distance = getDistance(depthTexture, v_textureCoordinates);
  vec4 sceneColor = TEXTURE_FUNC(colorTexture, v_textureCoordinates);
  float blendAmount = interpolateByDistance(fogByDistance, distance);
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
  vec4 result = alphaBlend(finalFogColor, sceneColor);
  
  #if __VERSION__ == 300
    fragColor = result;
  #else
    gl_FragColor = result;
  #endif
}
`;
  const Mm = [Z("color")],
    Em = {
      fogByDistance: {
        near: 100,
        nearValue: 0,
        far: 9e3,
        farValue: 1
      },
      color: "#fff"
    };
  class Dm extends Le {
    constructor(e = {}) {
      super(ye(Em, e));
      this.type = he.Fog
    }
    setOptions(e) {
      const i = oe(Mm, e);
      super.setOptions(i)
    }
    set enable(e) {
      this._enable = e, e && this._map && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set fogByDistance(e) {
      var i, n, s, o;
      this._fogByDistance = e, this._delegate && (this._delegate.uniforms.fogByDistance = new l.Cartesian4(((i = this._fogByDistance) == null ? void 0 : i.near) || 10, ((n = this._fogByDistance) == null ? void 0 : n.nearValue) || 0, ((s = this._fogByDistance) == null ? void 0 : s.far) || 2e3, ((o = this._fogByDistance) == null ? void 0 : o.farValue) || 1))
    }
    get fogByDistance() {
      return this._fogByDistance
    }
    set color(e) {
      this._color = e, this._delegate && (this._delegate.uniforms.fogColor = e)
    }
    get color() {
      return this._color
    }
    _createPostProcessStage() {
      var e, i, n, s;
      this._delegate = new l.PostProcessStage({
        name: this.id,
        fragmentShader: Tm,
        uniforms: {
          fogByDistance: new l.Cartesian4(((e = this._fogByDistance) == null ? void 0 : e.near) || 10, ((i = this._fogByDistance) == null ? void 0 : i.nearValue) || 0, ((n = this._fogByDistance) == null ? void 0 : n.far) || 200, ((s = this._fogByDistance) == null ? void 0 : s.farValue) || 1),
          fogColor: this._color
        }
      }), this._map.viewer.scene.postProcessStages.add(this._delegate)
    }
    destroy() {
      this._delegate && this._map.viewer.scene.postProcessStages.remove(this._delegate), super.destroy()
    }
  }
  var km = `
uniform sampler2D colorTexture;
uniform float speed;

#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
  in vec2 v_textureCoordinates;
  out vec4 fragColor;
#else
  #define TEXTURE_FUNC texture2D
  varying vec2 v_textureCoordinates;
#endif

float hash(float x){
  return fract(sin(x*23.3)*13.13);
}

void main(){
  float time = czm_frameNumber * speed / 1000.0;
  vec2 resolution = czm_viewport.zw;
  vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);
  vec3 c=vec3(.1,.2,.3);
  float a=-.3;
  float si=sin(a),co=cos(a);
  uv*=mat2(co,-si,si,co);
  uv*=length(uv+vec2(0,4.9))*.3+1.;
  float v=1.-sin(hash(floor(uv.x*100.))*2.);
  float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*10.;
  c*=v*b;
  
  vec4 result = mix(TEXTURE_FUNC(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
  #if __VERSION__ == 300
    fragColor = result;
  #else
    gl_FragColor = result;
  #endif
}
`;
  const zm = {
    speed: 10
  };
  class Im extends Le {
    constructor(e = {}) {
      super(ye(zm, e));
      this.type = he.Rain
    }
    set enable(e) {
      this._enable = e, e && this._map && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set speed(e) {
      this._speed = e, this._delegate && (this._delegate.uniforms.speed = e)
    }
    get speed() {
      return this._speed
    }
    _createPostProcessStage() {
      this._delegate = new l.PostProcessStage({
        name: this.id,
        fragmentShader: km,
        uniforms: {
          speed: this._speed
        }
      }), this._map.viewer.scene.postProcessStages.add(this._delegate)
    }
    destroy() {
      this._delegate && this._map.viewer.scene.postProcessStages.remove(this._delegate), super.destroy()
    }
  }
  var Om = `
uniform sampler2D colorTexture;
uniform float speed;

#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
  in vec2 v_textureCoordinates;
  out vec4 fragColor;
#else
  #define TEXTURE_FUNC texture2D
  varying vec2 v_textureCoordinates;
#endif

float snow(vec2 uv,float scale){
  float time = czm_frameNumber * speed / 1000.0 ;
  float w=smoothstep(1.,0.,-uv.y*(scale/10.));
  if(w<.1)return 0.;
  uv+=time/scale;
  uv.y+=time*2./scale;
  uv.x+=sin(uv.y+time*.5)/scale;
  uv*=scale;
  vec2 s=floor(uv),f=fract(uv),p;
  float k=3.,d;
  p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;
  d=length(p);
  k=min(d,k);
  k=smoothstep(0.,k,sin(f.x+f.y)*0.01);
  return k*w;
}

void main(){
  vec2 resolution = czm_viewport.zw;
  vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);
  vec3 finalColor=vec3(0);
  float c = 0.0;
  c+=snow(uv,10.);
  c+=snow(uv,8.);
  c+=snow(uv,6.);
  c+=snow(uv,5.);
  finalColor=(vec3(c));
  
  vec4 result = mix(TEXTURE_FUNC(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);
  #if __VERSION__ == 300
    fragColor = result;
  #else
    gl_FragColor = result;
  #endif
}
`;
  const Rm = {
    speed: 10
  };
  class Bm extends Le {
    constructor(e = {}) {
      super(ye(Rm, e));
      this.type = he.Snow
    }
    set enable(e) {
      this._enable = e, e && this._map && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set speed(e) {
      this._speed = e, this._delegate && (this._delegate.uniforms.speed = e)
    }
    get speed() {
      return this._speed
    }
    _createPostProcessStage() {
      this._delegate = new l.PostProcessStage({
        name: this.id,
        fragmentShader: Om,
        uniforms: {
          speed: this._speed
        }
      }), this._map.viewer.scene.postProcessStages.add(this._delegate)
    }
    destroy() {
      this._delegate && this._map.viewer.scene.postProcessStages.remove(this._delegate), super.destroy()
    }
  }
  var Lm = `
uniform sampler2D colorTexture;
uniform float brightness;
uniform float alpha;
#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
    in vec2 v_textureCoordinates;
      out vec4 fragColor;
#else
  #define TEXTURE_FUNC texture2D
  varying vec2 v_textureCoordinates;
#endif


void main(void)
{
    vec4 rgba = TEXTURE_FUNC(colorTexture, v_textureCoordinates);
    vec3 target = vec3(0.0);
    float a = rgba.a;
    if( alpha != 0.0 ) {
      a = alpha;
    }
    vec4 result = vec4(mix(target, rgba.rgb, brightness), a);
    
    #if __VERSION__ == 300
      fragColor = result;
    #else
      gl_FragColor = result;
    #endif
}
`;
  const Gm = {
    intensity: 1.5,
    alpha: 0,
    selected: []
  };
  class Fm extends Le {
    constructor(e = {}) {
      super(ye(Gm, e));
      this.type = he.Brightness
    }
    set enable(e) {
      this._enable = e, e && this._map && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set intensity(e) {
      this._intensity = e, this._delegate && (this._delegate.uniforms.brightness = e)
    }
    get intensity() {
      return this._intensity
    }
    set alpha(e) {
      this._alpha = e, this._delegate && (this._delegate.uniforms.alpha = e)
    }
    get alpha() {
      return this._alpha
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = new l.PostProcessStage({
        name: "czm_brightness2",
        fragmentShader: Lm,
        uniforms: {
          brightness: .5
        }
      }), this._delegate && (this._delegate.uniforms.brightness = this._intensity, this._delegate.uniforms.alpha = this._alpha, this._map.viewer.scene.postProcessStages.add(this._delegate))
    }
  }
  const Hm = {
    contrast: 128,
    brightness: -.3,
    glowOnly: !1,
    delta: 1,
    sigma: 3.8,
    stepSize: 5,
    selected: []
  };
  class Nm extends Le {
    constructor(e) {
      super(ye(Hm, e));
      this.type = he.Bloom
    }
    set enable(e) {
      this._enable = e, e && this._viewer && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set contrast(e) {
      this._contrast = e, this._delegate && (this._delegate.uniforms.contrast = e)
    }
    get contrast() {
      return this._contrast
    }
    set brightness(e) {
      this._brightness = e, this._delegate && (this._delegate.uniforms.brightness = e)
    }
    get brightness() {
      return this._brightness
    }
    set glowOnly(e) {
      this._glowOnly = e, this._delegate && (this._delegate.uniforms.glowOnly = e)
    }
    get glowOnly() {
      return this._glowOnly
    }
    set delta(e) {
      this._delta = e, this._delegate && (this._delegate.uniforms.delta = e)
    }
    get delta() {
      return this._delta
    }
    set sigma(e) {
      this._sigma = e, this._delegate && (this._delegate.uniforms.sigma = e)
    }
    get sigma() {
      return this._sigma
    }
    set stepSize(e) {
      this._stepSize = e, this._delegate && (this._delegate.uniforms.stepSize = e)
    }
    get stepSize() {
      return this._stepSize
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = this._viewer.scene.postProcessStages.bloom, this._delegate.uniforms.contrast = this._contrast, this._delegate.uniforms.brightness = this._brightness, this._delegate.uniforms.glowOnly = this._glowOnly, this._delegate.uniforms.delta = this._delta, this._delegate.uniforms.sigma = this._sigma, this._delegate.uniforms.stepSize = this._stepSize
    }
  }
  const Um = {
    focalDistance: 87,
    delta: 1,
    sigma: 3.8,
    stepSize: 2.5,
    selected: []
  };
  class Vm extends Le {
    constructor(e) {
      super(ye(Um, e));
      this.type = he.DepthOfField
    }
    set enable(e) {
      this._enable = e, e && this._viewer && l.PostProcessStageLibrary.isDepthOfFieldSupported(this._viewer.scene) && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set focalDistance(e) {
      this._focalDistance = e, this._delegate && (this._delegate.uniforms.focalDistance = e)
    }
    get focalDistance() {
      return this._focalDistance
    }
    set delta(e) {
      this._delta = e, this._delegate && (this._delegate.uniforms.delta = e)
    }
    get delta() {
      return this._delta
    }
    set sigma(e) {
      this._sigma = e, this._delegate && (this._delegate.uniforms.sigma = e)
    }
    get sigma() {
      return this._sigma
    }
    set stepSize(e) {
      this._stepSize = e, this._delegate && (this._delegate.uniforms.stepSize = e)
    }
    get stepSize() {
      return this._stepSize
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = l.PostProcessStageLibrary.createDepthOfFieldStage(), this._delegate && (this._delegate.uniforms.focalDistance = this._focalDistance, this._delegate.uniforms.delta = this._delta, this._delegate.uniforms.sigma = this._sigma, this._delegate.uniforms.stepSize = this._stepSize, this._viewer.scene.postProcessStages.add(this._delegate))
    }
  }
  const Wm = {
      color: "#00ff00",
      length: .5,
      selected: []
    },
    jm = [Z("color")];
  class qm extends Le {
    constructor(e) {
      super(ye(Wm, e));
      this.type = he.Silhouette
    }
    setOptions(e) {
      const i = oe(jm, e);
      super.setOptions(i)
    }
    set enable(e) {
      this._enable = e, !!this._map && (e && this._viewer && l.PostProcessStageLibrary.isSilhouetteSupported(this._viewer.scene) && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e))
    }
    get enable() {
      return this._enable
    }
    set color(e) {
      if (this._color = rt(e), this._delegate) {
        const i = this._delegate.uniforms.color;
        i.alpha = this._color.alpha, i.blue = this._color.blue, i.green = this._color.green, i.red = this._color.red
      }
    }
    get color() {
      return this._color
    }
    set length(e) {
      this._length = e, this._delegate && (this._delegate.uniforms.length = e)
    }
    get length() {
      return this._length
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = l.PostProcessStageLibrary.createSilhouetteStage(), console.log("_createPostProcessStage", this._delegate), this._delegate && (this._delegate.uniforms.color = this._color, this._delegate.uniforms.length = this._length, this._viewer.scene.postProcessStages.add(this._delegate))
    }
  }
  class Qm extends Le {
    constructor(e) {
      super(e);
      this.type = he.Night
    }
    set enable(e) {
      this._enable = e, e && this._viewer && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = l.PostProcessStageLibrary.createNightVisionStage(), this._delegate && this._viewer.scene.postProcessStages.add(this._delegate)
    }
  }
  const Ym = {
    gradations: 100,
    selected: []
  };
  class Xm extends Le {
    constructor(e) {
      super(ye(Ym, e));
      this.type = he.BlackAndWhite
    }
    set enable(e) {
      this._enable = e, e && this._viewer && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set gradations(e) {
      this._gradations = e, this._delegate && (this._delegate.uniforms.gradations = e)
    }
    get gradations() {
      return this._gradations
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = l.PostProcessStageLibrary.createBlackAndWhiteStage(), this._delegate && (this._delegate.uniforms.gradations = this._gradations, this._viewer.scene.postProcessStages.add(this._delegate))
    }
  }
  var Km = `
uniform sampler2D colorTexture;
uniform float brightness;
uniform float saturation;
uniform float contrast;


#if __VERSION__ == 300
  #define TEXTURE_FUNC texture
  in vec2 v_textureCoordinates;
#else
  #define TEXTURE_FUNC texture2D
  varying vec2 v_textureCoordinates;
#endif

void main(void)
{
    vec4 rgba = TEXTURE_FUNC(colorTexture, v_textureCoordinates);
    vec3 finalColor = rgba.rgb;
    float a = rgba.a;

    //\u8C03\u6574\u4EAE\u5EA6
    finalColor = finalColor * brightness;
   
    //\u8C03\u6574\u9971\u548C\u5EA6
    float luminance = 0.2125 * rgba.r + 0.7154 * rgba.g + 0.0721 * rgba.b;
    vec3 saturationTarget = vec3(luminance,luminance,luminance);
    finalColor = mix(saturationTarget, finalColor, saturation);
    
    //\u8C03\u6574\u5BF9\u6BD4\u5EA6
    vec3 contrastTarget = vec3(0.5,0.5,0.5);
    finalColor = mix(contrastTarget, finalColor, contrast);
    gl_FragColor = vec4(finalColor, a);
}
`;
  const Jm = {
    brightness: 1,
    saturation: 1,
    contrast: 1,
    selected: []
  };
  class $m extends Le {
    constructor(e = {}) {
      super(ye(Jm, e));
      this.type = he.Brightness
    }
    set enable(e) {
      this._enable = e, e && this._map && !this._delegate && this._createPostProcessStage(), this._delegate && (this._delegate.enabled = e)
    }
    get enable() {
      return this._enable
    }
    set brightness(e) {
      this._brightness = e, this._delegate && (this._delegate.uniforms.brightness = e)
    }
    get brightness() {
      return this._brightness
    }
    set saturation(e) {
      this._saturation = e, this._delegate && (this._delegate.uniforms.saturation = e)
    }
    get saturation() {
      return this._saturation
    }
    set contrast(e) {
      this._contrast = e, this._delegate && (this._delegate.uniforms.contrast = e)
    }
    get contrast() {
      return this._contrast
    }
    set selected(e) {
      this._selected = e, this._delegate && (this._delegate.selected = e)
    }
    get selected() {
      return this._selected
    }
    _createPostProcessStage() {
      this._delegate = new l.PostProcessStage({
        name: "visualImpact",
        fragmentShader: Km,
        uniforms: {
          brightness: 1,
          saturation: 1,
          contrast: 1
        }
      }), this._delegate && (this._delegate.uniforms.brightness = this._brightness, this._delegate.uniforms.saturation = this._saturation, this._delegate.uniforms.contrast = this._contrast, this._delegate.selected = this._selected, this._map.viewer.scene.postProcessStages.add(this._delegate))
    }
  }
  const Zm = {
    [he.Cloud]: Sm,
    [he.Fog]: Dm,
    [he.Rain]: Im,
    [he.Snow]: Bm,
    [he.Bloom]: Nm,
    [he.DepthOfField]: Vm,
    [he.Brightness]: Fm,
    [he.Silhouette]: qm,
    [he.Night]: Qm,
    [he.BlackAndWhite]: Xm,
    [he.VisualImpact]: $m
  };
  var eg = {
    _extendInit() {
      this.effects = []
    },
    addEffect(i = {}) {
      var n = i,
        {
          type: r
        } = n,
        e = re(n, ["type"]);
      const s = Zm[r];
      if (!s) {
        console.warn(`\u4E0D\u5B58\u5728type\u4E3A${r}\u7684effect`);
        return
      }
      const o = new s(j({}, e));
      return o.addTo(this), this.effects.push(o), o
    },
    updateEffect(n = {}) {
      var s = n,
        {
          id: r,
          show: e
        } = s,
        i = re(s, ["id", "show"]);
      if (!r) return;
      const o = this.getEffect(r);
      !o || (U(i) && o.setOptions(i), U(e) && (o.enable = e))
    },
    effectOptions: {},
    setEffectOptions(r) {
      this.effectOptions = ne(this.effectOptions, r), Object.keys(r).forEach(e => {
        const i = this.effectOptions[e],
          n = e;
        i.show ? this.getEffect(n) ? this.updateEffect(j({
          id: n
        }, i)) : this.addEffect(j({
          id: n,
          type: n
        }, i)) : this.removeEffect(n)
      })
    },
    getEffect(r) {
      if (!!r) return r instanceof Le ? r : this.effects.find(e => e.id === r)
    },
    removeEffect(r) {
      const e = this.getEffect(r);
      if (!e) return;
      const i = this.effects.findIndex(n => n === e);
      i !== -1 && (this.effects.splice(i, 1), e.state !== me.DESTROYED && e.destroy())
    },
    removeAllEffect() {
      this.effects.forEach(r => r.destroy())
    }
  };
  const {
    BoxGeometry: $a,
    Cartesian3: tg,
    defined: Je,
    DeveloperError: Za,
    GeometryPipeline: ig,
    Matrix3: el,
    Matrix4: vn,
    Transforms: rg,
    VertexFormat: ng,
    BufferUsage: sg,
    CubeMap: og,
    loadCubeMap: ag,
    RenderState: lg,
    VertexArray: cg,
    BlendingState: hg,
    SceneMode: tl,
    ShaderProgram: ug,
    ShaderSource: dg
  } = l, pg = `
  uniform samplerCube u_cubeMap;
  varying vec3 v_texCoord;
  void main()
  {
    vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));
    gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
  }
`, fg = `
  attribute vec3 position;
  varying vec3 v_texCoord;
  uniform mat3 u_rotateMatrix;
  void main()
  {
    vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
    gl_Position = czm_projection * vec4(p, 1.0);
    v_texCoord = position.xyz;
  }
`;
  class mg extends l.SkyBox {
    constructor(e = {}) {
      super(e);
      this.offsetAngle = (e == null ? void 0 : e.offsetAngle) || 0
    }
    update(e, i) {
      const n = this;
      if (!this.show || e.mode !== tl.SCENE3D && e.mode !== tl.MORPHING || !e.passes.render) return;
      const s = e.context;
      if (this._sources !== this.sources) {
        this._sources = this.sources;
        const a = this.sources;
        if (!Je(a.positiveX) || !Je(a.negativeX) || !Je(a.positiveY) || !Je(a.negativeY) || !Je(a.positiveZ) || !Je(a.negativeZ)) throw new Za("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");
        if (typeof a.positiveX != typeof a.negativeX || typeof a.positiveX != typeof a.positiveY || typeof a.positiveX != typeof a.negativeY || typeof a.positiveX != typeof a.positiveZ || typeof a.positiveX != typeof a.negativeZ) throw new Za("this.sources properties must all be the same type.");
        typeof a.positiveX == "string" ? ag(s, this._sources).then(c => {
          n._cubeMap = n._cubeMap && n._cubeMap.destroy(), n._cubeMap = c
        }) : (this._cubeMap = this._cubeMap && this._cubeMap.destroy(), this._cubeMap = new og({
          context: s,
          source: a
        }))
      }
      const o = this._command;
      if (o.modelMatrix = rg.eastNorthUpToFixedFrame(e.camera.positionWC), this.offsetAngle !== 0 && vn.multiply(o.modelMatrix, vn.fromRotationTranslation(el.fromRotationZ(this.offsetAngle / 180 * Math.PI)), o.modelMatrix), !Je(o.vertexArray)) {
        o.uniformMap = {
          u_cubeMap() {
            return n._cubeMap
          },
          u_rotateMatrix() {
            return vn.getMatrix3(o.modelMatrix, new el)
          }
        };
        const a = $a.createGeometry($a.fromDimensions({
            dimensions: new tg(2, 2, 2),
            vertexFormat: ng.POSITION_ONLY
          })),
          c = this._attributeLocations = ig.createAttributeLocations(a);
        o.vertexArray = cg.fromGeometry({
          context: s,
          geometry: a,
          attributeLocations: c,
          bufferUsage: sg._DRAW
        }), o.renderState = lg.fromCache({
          blending: hg.ALPHA_BLEND
        })
      }
      if (!Je(o.shaderProgram) || this._useHdr !== i) {
        const a = new dg({
          defines: [i ? "HDR" : ""],
          sources: [pg]
        });
        o.shaderProgram = ug.fromCache({
          context: s,
          vertexShaderSource: fg,
          fragmentShaderSource: a,
          attributeLocations: this._attributeLocations
        }), this._useHdr = i
      }
      if (!!Je(this._cubeMap)) return o
    }
  }
  const $e = l.buildModuleUrl,
    gg = l.defaultValue,
    yg = l.defined,
    vg = l.destroyObject,
    _g = l.DeveloperError,
    il = l.FeatureDetection,
    rl = l.knockout,
    wg = l.NavigationHelpButtonViewModel;

  function _t(r) {
    if (!yg(r)) throw new _g("options.container is required.");
    const e = document.querySelector(".cesium-viewer-toolbar"),
      i = new wg,
      n = gg(r.instructionsInitiallyVisible, !1);
    i.showInstructions = n, i._svgPath = "M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";
    const s = document.createElement("span");
    s.className = "cesium-navigationHelpButton-wrapper", e.appendChild(s);
    const o = document.createElement("button");
    o.type = "button", o.className = "cesium-button cesium-toolbar-button cesium-navigation-help-button", o.setAttribute("data-bind", "attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"), s.appendChild(o);
    const a = document.createElement("div");
    a.className = "cesium-navigation-help", a.setAttribute("data-bind", 'css: { "cesium-navigation-help-visible" : showInstructions}'), s.appendChild(a);
    const c = document.createElement("button");
    c.type = "button", c.className = "cesium-navigation-button cesium-navigation-button-left", c.setAttribute("data-bind", 'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');
    const h = document.createElement("img");
    h.src = $e("Widgets/Images/NavigationHelp/Mouse.svg"), h.className = "cesium-navigation-button-icon", h.style.width = "25px", h.style.height = "25px", c.appendChild(h), c.appendChild(document.createTextNode("\u9F20\u6807\u64CD\u4F5C"));
    const u = document.createElement("button");
    u.type = "button", u.className = "cesium-navigation-button cesium-navigation-button-right", u.setAttribute("data-bind", 'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');
    const d = document.createElement("img");
    d.src = $e("Widgets/Images/NavigationHelp/Touch.svg"), d.className = "cesium-navigation-button-icon", d.style.width = "25px", d.style.height = "25px", u.appendChild(d), u.appendChild(document.createTextNode("\u89E6\u6478\u624B\u52BF")), a.appendChild(c), a.appendChild(u);
    const p = document.createElement("div");
    p.className = "cesium-click-navigation-help cesium-navigation-help-instructions", p.setAttribute("data-bind", 'css: { "cesium-click-navigation-help-visible" : !_touch}'), p.innerHTML = `            <table>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">\u5E73\u79FB\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u9F20\u6807\u5DE6\u952E+\u62D6\u62FD</div>                    </td>                </tr>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">\u7F29\u653E\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u53F3\u952E+\u62D6\u62FD\uFF0C\u6216\u8005</div>                        <div class="cesium-navigation-help-details">\u4E2D\u952E\u6EDA\u52A8</div>                    </td>                </tr>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">\u65CB\u8F6C\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u4E2D\u952E\u6309\u4E0B\u62D6\u62FD\uFF0C\u6216\u8005</div>                        <div class="cesium-navigation-help-details">\u6309Ctrl\u952E \u540C\u65F6 \u5DE6/\u53F3\u952E\u62D6\u62FD</div>                    </td>                </tr>            </table>`, a.appendChild(p);
    const f = document.createElement("div");
    f.className = "cesium-touch-navigation-help cesium-navigation-help-instructions", f.setAttribute("data-bind", 'css: { "cesium-touch-navigation-help-visible" : _touch}'), f.innerHTML = `            <table>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">\u5E73\u79FB\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u5355\u6307\u62D6\u52A8</div>                    </td>                </tr>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">\u7F29\u653E\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u53CC\u6307\u5411\u5185\u6216\u5411\u5916\u6ED1\u52A8</div>                    </td>                </tr>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">\u503E\u659C\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u53CC\u6307\u6309\u76F8\u540C\u65B9\u5411\u62D6\u52A8</div>                    </td>                </tr>                <tr>                    <td><img src="${$e("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">\u65CB\u8F6C\u89C6\u56FE</div>                        <div class="cesium-navigation-help-details">\u53CC\u6307\u6309\u76F8\u53CD\u65B9\u5411\u62D6\u52A8</div>                    </td>                </tr>            </table>`, a.appendChild(f), rl.applyBindings(i, s), this._container = e, this._viewModel = i, this._wrapper = s, this._closeInstructions = function (m) {
      s.contains(m.target) || (i.showInstructions = !1)
    }, il.supportsPointerEvents() ? document.addEventListener("pointerdown", this._closeInstructions, !0) : (document.addEventListener("mousedown", this._closeInstructions, !0), document.addEventListener("touchstart", this._closeInstructions, !0))
  }
  Object.defineProperties(_t.prototype, {
    container: {
      get() {
        return this._container
      }
    },
    viewModel: {
      get() {
        return this._viewModel
      }
    }
  }), _t.prototype.isDestroyed = function () {
    return !1
  }, _t.prototype.toggle = function () {
    this._viewModel.command()
  }, _t.prototype.show = function () {
    this._viewModel.showInstructions = !0
  }, _t.prototype.hide = function () {
    this._viewModel.showInstructions = !1
  }, _t.prototype.destroy = function () {
    return il.supportsPointerEvents() ? document.removeEventListener("pointerdown", this._closeInstructions, !0) : (document.removeEventListener("mousedown", this._closeInstructions, !0), document.removeEventListener("touchstart", this._closeInstructions, !0)), rl.cleanNode(this._wrapper), this._container.removeChild(this._wrapper), vg(this)
  };
  class nl {
    geocode(e) {
      const i = "//restapi.amap.com/v3/place/text";
      return new l.Resource({
        url: i,
        queryParameters: {
          keywords: e,
          key: et.gaode
        }
      }).fetchJson().then(s => s.pois.map(o => {
        const a = o.location.split(",");
        return {
          displayName: o.name,
          destination: Wr(l.Cartesian3.fromDegrees(a[0], a[1], 0), 1e4)
        }
      }))
    }
  }
  class sl {
    geocode(e) {
      const i = "//api.map.baidu.com/place/v2/search";
      return new l.Resource({
        url: i,
        queryParameters: {
          query: e,
          ak: et.badiu,
          output: "json",
          region: "\u5168\u7403"
        }
      }).fetchJsonp().then(s => s.results.map(o => {
        const a = o.location;
        return {
          displayName: o.name,
          destination: Wr(l.Cartesian3.fromDegrees(a.lng, a.lat, 0), 1e4)
        }
      }))
    }
  }
  class ol {
    constructor() {
      P(this, "time", 0)
    }
    geocode(e) {
      const i = "//api.tianditu.gov.cn/v2/search",
        n = new l.Resource({
          url: i,
          queryParameters: {
            type: "query",
            tk: et.tianditu,
            postStr: JSON.stringify({
              queryType: "4",
              start: 0,
              keyWord: e,
              count: 4,
              mapBound: "-180,-90,180,90",
              level: 18,
              yingjiType: 1,
              sourceType: 0,
              queryTerminal: 1e4
            })
          }
        });
      let s = ++this.time;
      return n.fetchJson().then(o => {
        if (+o.resultType == 3) return [{
          displayName: o.area.name,
          destination: l.Rectangle.fromCartesianArray(l.Cartesian3.fromDegreesArray(o.area.bound.split(",")))
        }];
        if (+o.resultType == 4) return Promise.all(o.suggests.slice(0, 4).map(async a => {
          const c = await new l.Resource({
            url: i,
            queryParameters: {
              type: "query",
              tk: et.tianditu,
              postStr: JSON.stringify({
                queryType: "1",
                start: 0,
                keyWord: a.name,
                count: 4,
                mapBound: "-180,-90,180,90",
                level: 18,
                sourceType: 0,
                yingjiType: 0,
                queryTerminal: 1e4,
                specify: a.gbCode
              })
            }
          }).fetchJson();
          if (+c.resultType == 1 && c.pois.length) return {
            displayName: c.keyWord,
            destination: Wr(l.Cartesian3.fromDegrees(...c.pois[0].lonlat.split(","), 0), 1e3)
          }
        })).then(a => s !== this.time ? [] : a.filter(Boolean))
      })
    }
  }
  var Cg = Object.freeze({
    __proto__: null,
    [Symbol.toStringTag]: "Module",
    GaodeGeocoder: nl,
    BaiduGeocoder: sl,
    TdtGeocoder: ol
  });
  class xg {
    constructor(e, {
      enCollision: i = !1,
      moveRate: n = 200,
      rotateAxis: s,
      rotateRate: o = .01,
      collision: a,
      afterMove: c = () => {}
    } = {}) {
      this._map = e, this._viewer = e.viewer, this._enable = !1, this._moveRate = n, this._rotateRate = o, this.enCollision = i, this._rotateAxis = s, this._afterMove = c, this.collision = a || e.collision.bind(e), this._flags = {
        moveForward: !1,
        moveBackward: !1,
        moveUp: !1,
        moveDown: !1,
        moveLeft: !1,
        moveRight: !1,
        turnLeft: !1,
        turnRight: !1
      }
    }
    set enable(e) {
      this._enable !== e && this._viewer.scene.mode === l.SceneMode.SCENE3D && (this._enable = e, this._enable ? this._bindEvent() : this._unbindEvent())
    }
    get enable() {
      return this._enable
    }
    set moveRate(e) {
      this._moveRate = e
    }
    get moveRate() {
      return this._moveRate
    }
    set rotateRate(e) {
      this._rotateRate = e
    }
    get rotateRate() {
      return this._rotateRate
    }
    _bindEvent() {
      let e = this._viewer.scene.canvas;
      e.setAttribute("tabindex", "0"), e.addEventListener("click", this._onClick.bind(this), !1), this._viewer.clock.onTick.addEventListener(this._onTick, this), document.addEventListener("keydown", this._onKeydown.bind(this), !1), document.addEventListener("keyup", this._onKeyup.bind(this), !1)
    }
    _unbindEvent() {
      Object.keys(this._flags).forEach(i => {
        this._flags[i] = !1
      });
      let e = this._viewer.scene.canvas;
      e.removeAttribute("tabindex"), e.removeEventListener("click", this._onClick, !1), this._viewer.clock.onTick.removeEventListener(this._onTick, this), document.removeEventListener("keydown", this._onKeydown, !1), document.removeEventListener("keyup", this._onKeyup, !1)
    }
    _getFlagForKeyCode(e) {
      let i;
      switch (e.keyCode) {
        case "W".charCodeAt(0):
        case 38:
          e.shiftKey ? i = "moveUp" : i = "moveForward";
          break;
        case "S".charCodeAt(0):
        case 40:
          e.shiftKey ? i = "moveDown" : i = "moveBackward";
          break;
        case "A".charCodeAt(0):
        case 37:
          i = "moveLeft";
          break;
        case "D".charCodeAt(0):
        case 39:
          i = "moveRight";
          break;
        case "Q".charCodeAt(0):
          i = "turnLeft";
          break;
        case "E".charCodeAt(0):
          i = "turnRight";
          break
      }
      return i
    }
    _onClick() {
      this._viewer.scene.canvas.focus()
    }
    _onKeydown(e) {
      let i = this._getFlagForKeyCode(e);
      i && (this._flags[i] = !0)
    }
    _onKeyup(e) {
      Object.keys(this._flags).forEach(i => {
        this._flags[i] = !1
      }), this._map.fire("keyboardRoaming")
    }
    _onTick() {
      let e = this._viewer.scene.camera,
        i;
      i = this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e.positionWC).height / this._moveRate;
      let s = this._rotateAxis || l.Cartesian3.clone(e.positionWC, new l.Cartesian3);
      if (this._flags.moveForward) {
        const o = this._viewer.camera.direction.clone();
        l.Matrix4.equals(l.Matrix4.IDENTITY, this._viewer.camera._transform) || (o.z = 0), this.move(o, i)
      }
      if (this._flags.moveBackward) {
        const o = this._viewer.camera.direction.clone();
        l.Matrix4.equals(l.Matrix4.IDENTITY, this._viewer.camera._transform) || (o.z = 0), this.move(o, -i)
      }
      this._flags.moveUp && this.move(this._viewer.camera.up, i), this._flags.moveDown && this.move(this._viewer.camera.up, -i), this._flags.moveLeft && this.move(this._viewer.camera.right, -i), this._flags.moveRight && this.move(this._viewer.camera.right, i), this._flags.turnLeft && e.rotate(s, -this._rotateRate), this._flags.turnRight && e.rotate(s, this._rotateRate)
    }
    move(e, i) {
      const s = this._map.camera;
      if (this.enCollision) {
        const o = l.Cartesian3.multiplyByScalar(e, -i, new l.Cartesian3);
        if (this.collision(s.positionWC, l.Cartesian3.add(s.positionWC.clone(), o, o))) return
      }
      this._viewer.camera.move(e, i), this._afterMove()
    }
    destroy() {
      this.enable = !1, this._map = null, this._viewer = null, this.collision = null
    }
  }
  class _n {
    constructor(e) {
      P(this, "isRotating", !1);
      this._map = e, this._viewer = e.viewer, this._options = {}
    }
    _bindEvent() {}
    _unbindEvent() {}
    start() {
      if (this.isRotating = !0, this._viewer.clock.shouldAnimate = !0, this._unbindEvent(), this._options.duration) {
        let e = setTimeout(() => {
          this._unbindEvent(), this._options.callback && this._options.callback.call(this._options.context || this), clearTimeout(e), e = null
        }, Number(this._options.duration) * 1e3)
      }
      return this._bindEvent(), this
    }
    stop() {
      if (!!this.isRotating) return this._options.callback && this._options.callback.call(this._options.context || this), this._unbindEvent(), this.isRotating = !1, this
    }
    destroy() {
      this._map = null, this._viewer = null, this.isRotating && this.stop(), this.timer && (clearTimeout(this.timer), this.timer = null)
    }
  }
  class bg extends _n {
    constructor(e, i = {}) {
      super(e);
      const n = e.viewer;
      this._position = new R(i.position || e.getCenterPoint()), this._options = i, this._heading = n.camera.heading, this._speed = i.speed || .2, this.type = "around_point"
    }
    set position(e) {
      this._position = new R(e)
    }
    set speed(e) {
      this._speed = e
    }
    _bindEvent() {
      this._viewer.clock.onTick.addEventListener(this._onAround, this)
    }
    _unbindEvent() {
      this._viewer.camera.lookAtTransform(l.Matrix4.IDENTITY), this._viewer.clock.onTick.removeEventListener(this._onAround, this)
    }
    start() {
      this._defaultRange = l.Cartesian3.distance(this._viewer.camera.position, this._map.getCenterPoint()), this._defaultPitch = l.Math.toDegrees(this._viewer.camera.pitch), super.start()
    }
    _onAround(e, i) {
      this._heading += l.Math.toRadians(this._speed), (this._heading >= Math.PI * 2 || this._heading <= -Math.PI * 2) && (this._heading = 0), this._viewer.camera.lookAt(this._position, new l.HeadingPitchRange(this._heading, l.Math.toRadians(this._options.pitch || this._defaultPitch || 0), this._options.range || this._defaultRange || 1e3))
    }
  }
  class Ag extends _n {
    constructor(e, i = {}) {
      super(e);
      var s;
      const n = e.viewer;
      this._options = i, this._heading = n.camera.heading, this._speed = (s = i.speed) != null ? s : .2, this.type = "around_view"
    }
    set speed(e) {
      this._speed = e
    }
    _bindEvent() {
      this._viewer.clock.onTick.addEventListener(this._onAround, this)
    }
    _unbindEvent() {
      this._viewer.camera.lookAtTransform(l.Matrix4.IDENTITY), this._viewer.clock.onTick.removeEventListener(this._onAround, this)
    }
    _onAround(e, i) {
      this._heading += l.Math.toRadians(this._speed), (this._heading >= Math.PI * 2 || this._heading <= -Math.PI * 2) && (this._heading = 0), this._viewer.scene.camera.setView({
        orientation: {
          heading: this._heading,
          pitch: this._viewer.camera.pitch,
          roll: this._viewer.camera.roll
        }
      })
    }
  }
  class Pg extends _n {
    constructor(e, i = {}) {
      super(e);
      this._options = i, this.type = "globe_rotate"
    }
    _icrf(e, i) {
      if (e.mode !== l.SceneMode.SCENE3D) return !0;
      let n = l.Transforms.computeIcrfToFixedMatrix(i);
      if (n) {
        let s = this._viewer.camera,
          o = l.Cartesian3.clone(s.position),
          a = l.Matrix4.fromRotationTranslation(n);
        s.lookAtTransform(a, o)
      }
    }
    _bindEvent() {
      this._viewer.clock.multiplier = this._options.speed || 12 * 1e3, this._viewer.camera.lookAtTransform(l.Matrix4.IDENTITY), this._viewer.scene.postUpdate.addEventListener(this._icrf, this)
    }
    _unbindEvent() {
      this._viewer.clock.multiplier = 1, this._viewer.camera.lookAtTransform(l.Matrix4.IDENTITY), this._viewer.scene.postUpdate.removeEventListener(this._icrf, this)
    }
  }
  class Sg extends l.Viewer {
    constructor(e, i) {
      var s;
      const n = i.scene.terrainProvider;
      i.scene.terrainProvider = null;
      super(e, se(j({}, i), {
        imageryProvider: i.imageryProvider instanceof Object ? i.imageryProvider : !1,
        navigationHelpButton: !1,
        geocoder: ge(i.geocoder) ? i.geocoder : []
      }));
      i.scene.terrainProvider = n, (s = document.querySelector(".cesium-geocoder-input")) == null || s.setAttribute("placeholder", "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD"), this.cesiumWidget.screenSpaceEventHandler.removeInputAction(l.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.shadowMap.size = 2048 * 4, this.shadowMap.darkness = .5
    }
  }
  class Tg {
    constructor({
      map: e,
      enCollision: i = !1,
      moveType: n = l.CameraEventType.LEFT_DRAG,
      rotateType: s = l.CameraEventType.MIDDLE_DRAG
    }) {
      this._map = e, this._enableInputs = e.viewer.scene.screenSpaceCameraController.enableInputs, e.viewer.scene.screenSpaceCameraController.enableInputs = !1, this._aggregator = new l.CameraEventAggregator(e.viewer.scene.canvas), this._effects = [this._bindMove(), this._bindZoom(), this._bindRotate()], this.enCollision = i, this.moveType = n, this.rotateType = s
    }
    _bindMove() {
      const e = this._map,
        i = this._aggregator,
        n = e.viewer.camera;
      return e.on("mousedown", () => {
        const s = e.on("postRender", () => {
          const o = this.moveType,
            a = i.isMoving(o) && i.getMovement(o),
            c = i.getStartMousePosition(o);
          if (!a) {
            i.reset();
            return
          }
          const h = a.endPosition.x - a.startPosition.x,
            u = a.endPosition.y - a.startPosition.y,
            d = e.getPointFromScreenPX(c);
          let p = e.getPxMeter(d);
          if (p = p > .05 ? .05 : p, h) {
            const f = l.Cartesian3.multiplyByScalar(n.right, -p * h, new l.Cartesian3);
            (!this.enCollision || !e.collision(n.positionWC, l.Cartesian3.add(n.positionWC.clone(), f, f))) && n.moveLeft(p * h)
          }
          if (u) {
            const f = l.Cartesian3.multiplyByScalar(n.up, p * u, new l.Cartesian3);
            (!this.enCollision || !e.collision(n.positionWC, l.Cartesian3.add(n.positionWC.clone(), f, f))) && n.moveUp(p * u)
          }
          i.reset()
        });
        e.once("mouseup", () => {
          i.reset(), s()
        })
      })
    }
    _bindZoom() {
      const e = this._map,
        i = e.viewer.camera;
      return e.on("wheel", n => {
        if (!n) return;
        const s = n > 0 ? 1 : -1,
          o = l.Cartesian3.multiplyByScalar(i.direction, s, new l.Cartesian3);
        (!this.enCollision || !e.collision(i.positionWC, l.Cartesian3.add(i.positionWC.clone(), o, o))) && i.zoomIn(s)
      })
    }
    _bindRotate() {
      const e = this._map,
        i = e.viewer,
        n = this._aggregator,
        s = e.viewer.camera;
      return e.on("middledown", () => {
        const o = l.Transforms.eastNorthUpToFixedFrame(i.camera.positionWC);
        i.camera.lookAtTransform(o);
        const a = e.on("postRender", () => {
          const c = this.rotateType,
            h = n.isMoving(c) && n.getMovement(c),
            u = n.getStartMousePosition(c);
          if (!h) {
            n.reset();
            return
          }
          const d = h.endPosition.x - h.startPosition.x,
            p = h.endPosition.y - h.startPosition.y,
            f = e.getPointFromScreenPX(u);
          if (!f) return;
          let m = e.getPxMeter(f);
          m = m > .15 ? .15 : m, s.rotateLeft(Math.PI / 60 * m * d), s.rotateDown(Math.PI / 60 * m * p), n.reset()
        });
        e.once("middleup", () => {
          n.reset(), i.camera.lookAtTransform(l.Matrix4.IDENTITY), a()
        })
      })
    }
    destroy() {
      this._map && (this._map.viewer.scene.screenSpaceCameraController.enableInputs = this._enableInputs, this._map = null), this._effects && (this._effects.forEach(e => e()), this._effects = null), this._aggregator && (this._aggregator.destroy(), this._aggregator = null)
    }
  }
  class Mg {
    constructor(s) {
      var o = s,
        {
          map: e,
          target: i
        } = o,
        n = re(o, ["map", "target"]);
      i && i.isGraphic && (i = i.center), i || (i = e.getCenterPoint()), this._map = e, this.target = i, this._inverseTransform = e.camera.inverseTransform.clone(), this.update(n), this._aggregator = new l.CameraEventAggregator(e.viewer.scene.canvas), this._bindEvent()
    }
    _bindEvent() {
      const e = this._map,
        i = this._aggregator;
      e.on("middledown", () => {
        const n = l.CameraEventType.MIDDLE_DRAG,
          s = e.getCenterPoint();
        if (!s) return;
        this.target = s;
        const o = e.on("postRender", () => {
          const a = i.isMoving(n) && i.getMovement(n);
          if (!a) {
            i.reset();
            return
          }
          if (!e.getPxMeter(this.target)) {
            i.reset();
            return
          }
          const h = e.getPointFromScreenPX(a.startPosition).toMercator(),
            u = e.getPointFromScreenPX(a.endPosition).toMercator(),
            d = u.x - h.x,
            p = u.y - h.y,
            f = this.target.toMercator();
          f.x -= d, f.y -= p, this.target = R.fromMercator(f), this.update(), i.reset()
        });
        e.once("middleup", () => {
          i.reset(), o()
        })
      })
    }
    update({
      heading: e = this._map.camera.heading,
      pitch: i = this._map.camera.pitch,
      range: n
    } = {}) {
      const s = this._map,
        o = this._map.viewer,
        a = this.target;
      ce(n) && (n = s.intersection(s.getScreenCenterPX(), a).distance(s.viewer.camera.positionWC)), o.camera.lookAt(a, new l.HeadingPitchRange(e, i, n))
    }
    destroy() {
      this._aggregator && (this._aggregator.destroy(), this._aggregator = null), this._map && (this._inverseTransform && (this._map.viewer.camera.lookAtTransform(this._inverseTransform), this._inverseTransform = null), this._map = null)
    }
  }
  class Eg {
    constructor({
      map: e
    }) {
      this._map = e, this.setEventType("three")
    }
    setEventType(e) {
      const i = this._map.viewer,
        n = l.CameraEventType,
        s = l.KeyboardEventModifier,
        a = {
          default: {
            rotateEventTypes: n.LEFT_DRAG,
            tiltEventTypes: [n.MIDDLE_DRAG, n.PINCH, {
              eventType: n.LEFT_DRAG,
              modifier: s.CTRL
            }, {
              eventType: n.RIGHT_DRAG,
              modifier: s.CTRL
            }],
            translateEventTypes: n.LEFT_DRAG,
            zoomEventTypes: [n.RIGHT_DRAG, n.WHEEL, n.PINCH]
          },
          three: {
            rotateEventTypes: [n.RIGHT_DRAG, n.PINCH],
            tiltEventTypes: n.LEFT_DRAG,
            translateEventTypes: [n.RIGHT_DRAG, n.PINCH],
            zoomEventTypes: [n.MIDDLE_DRAG, n.WHEEL, n.PINCH]
          }
        } [e];
      Object.entries(a).forEach(([c, h]) => {
        i.scene.screenSpaceCameraController[c] = h
      })
    }
    destroy() {
      this._map && (this.setEventType("default"), this._map = null)
    }
  }
  class Dg {
    constructor() {
      this._cache = {}
    }
    loadImage(e) {
      return l.Resource.createIfNeeded(e).fetchImage()
    }
    async fromText(e, i, n) {
      if (e instanceof HTMLImageElement) return this.fromTextSync(e, i, n);
      const s = JSON.stringify({
        url: e,
        textStyle: i,
        imageStyle: {
          width: n.width,
          height: n.height
        }
      });
      if (this._cache[s]) return this._cache[s];
      const o = await this.loadImage(e);
      return this._cache[s] = al(o, i, n)
    }
    fromTextSync(e, i, n) {
      const s = JSON.stringify({
        url: e.src,
        textStyle: i,
        imageStyle: {
          width: n.width,
          height: n.height
        }
      });
      return this._cache[s] ? this._cache[s] : this._cache[s] = al(e, i, n)
    }
    destroy() {
      this._cache = null
    }
  }

  function al(r, e, i) {
    var o, a;
    let n = document.createElement("canvas");
    return n.width = (o = i.width) != null ? o : r.width, n.height = (a = i.height) != null ? a : r.height, n.getContext("2d").drawImage(r, 0, 0, n.width, n.height), e && e.text.split(`
`).forEach((c, h) => {
      const u = l.writeTextToCanvas(c, j({
        padding: 2
      }, e));
      kg(n, u, se(j({}, e), {
        pixelOffset: e.pixelOffset && {
          x: e.pixelOffset.x,
          y: (e.pixelOffset.y || 0) + h * (e.lineHeight || 1) * (e.fontSize || 30)
        }
      }))
    }), n.toDataURL()
  }

  function kg(r, e, i = {}) {
    const {
      pixelOffset: {
        x: n = 0,
        y: s = 0
      } = {}
    } = i;
    r.getContext("2d").drawImage(e, r.width / 2 - e.width / 2 + n, r.height / 2 - e.height / 2 + s, e.width, e.height)
  }
  class zg {
    constructor({
      map: e,
      style: i
    }) {
      P(this, "style", {});
      this._map = e, this._init(), i && this.setStyle(i)
    }
    set text(e) {
      e ? this.show() : this.hide(), this.setStyle({
        html: `<div style="background: rgba(0,0,0,.8);border-radius: 3px;padding:2px 6px;font-size:10px;color: #fff;">${e}</div>`
      })
    }
    setStyle(e) {
      this.style = ne(this.style, e);
      const {
        html: i,
        zIndex: n
      } = this.style, s = this._dom;
      eo(i) ? (s.innerHTML = "", s.appendChild(i)) : s.innerHTML = i, pe(s, {
        position: "absolute",
        left: 0,
        top: 0,
        zIndex: n,
        "pointer-events": "none"
      })
    }
    show() {
      if (!this.visible && this._dom) {
        this.visible = !0, pe(this._dom, {
          display: "block",
          visibility: "hidden"
        });
        const e = this._map.viewer.scene.canvas;
        this._mouseMoveCancels || (this._mouseMoveCancels = [$t(e, "pointermove", ({
          offsetX: i,
          offsetY: n
        }) => {
          const s = `translate(15px,-50%) translate(${i}px,${n}px)`;
          pe(this._dom, {
            transform: s,
            visibility: "visible"
          })
        }), $t(e, "mouseleave", () => {
          this.visible && pe(this._dom, {
            visibility: "hidden"
          })
        }), $t(e, "mouseenter", () => {
          this.visible && pe(this._dom, {
            visibility: "visible"
          })
        })])
      }
    }
    hide() {
      !this.visible || this._dom && (this.visible = !1, pe(this._dom, {
        display: "none"
      }), this._mouseMoveCancels && (this._mouseMoveCancels.forEach(e => e()), this._mouseMoveCancels = null))
    }
    _init() {
      this._dom = to("div"), this._map.viewer.container.appendChild(this._dom)
    }
    destroy() {
      this._dom && (this._map.viewer.container.removeChild(this._dom), this._dom = null), this._mouseMoveCancels && (this._mouseMoveCancels.forEach(e => e()), this._mouseMoveCancels = null)
    }
  }
  class Ig extends vr {
    _initEvent({
      optimizeEvents: e = !1
    }) {
      this._handler = new l.ScreenSpaceEventHandler(this.viewer.scene.canvas), Object.keys(Yt).forEach(i => {
        e && i === K.Mousemove || (this.events[i] = this._createObserver(i))
      }), e && (this.events[K.Mousemove] = this._createMouseMoveObserver(K.Mousemove))
    }
    _createMouseMoveObserver(e) {
      return Bu({
        map: this,
        handler: this._handler,
        eventName: e
      })
    }
    _createObserver(e) {
      return Ru({
        map: this,
        handler: this._handler,
        eventName: e
      })
    }
  }
  const Og = new l.Cartesian4(1, 1 / 255, 1 / 65025, 1 / 16581375);
  class Rg {
    constructor(e) {
      this._viewer = e
    }
    destroy() {
      this._viewer = null
    }
    _startFrame(e, i) {
      const n = e.map(A => new R(A)),
        s = R.fromPositions(n),
        o = new l.Picking(this._viewer.scene),
        a = o._pickOffscreenView,
        c = l.BoundingRectangle.fromRectangle(l.Rectangle.fromCartesianArray(n));
      c.x = 0, c.y = 0, c.width = Math.floor(c.width), c.height = Math.floor(c.height);
      const h = new l.BoundingRectangle(0, 0, Math.max(Math.floor(c.width / i), 1), Math.max(Math.floor(c.height / i), 1)),
        u = new R(s, {
          addHeight: 9e3
        }),
        d = l.Cartesian3.normalize(l.Cartesian3.subtract(s, u, new l.Cartesian3), new l.Cartesian3),
        p = new l.Ray(u, d),
        f = l.Cartesian3.normalize(l.Matrix4.multiplyByPoint(l.Transforms.northEastDownToFixedFrame(s), l.Cartesian3.UNIT_Y, new l.Cartesian3), new l.Cartesian3);
      this._updateOffscreenCamera(p, f, a.camera, c.width, c.height), a.viewport = h, a.passState.viewport = h;
      const m = this._viewer.scene.context,
        g = this._viewer.scene.frameState;
      this._viewer.scene.view = a;
      const y = a.pickFramebuffer.begin(h, a.viewport);
      this._viewer.scene.jobScheduler.disableThisFrame(), this._viewer.scene.updateFrameState(), g.invertClassification = !1, g.passes.pick = !0, g.passes.offscreen = !0, g.tilesetPassState = new l.Cesium3DTilePassState({
        pass: l.Cesium3DTilePass.PICK
      }), m.uniformState.update(g);
      const x = this._viewer.scene;
      return this._viewer.scene.updateEnvironment(), x.environmentState.clearGlobeDepth = !1, this._viewer.scene.updateAndExecuteCommands(y, new l.Color(0, 0, 0, 0)), this._viewer.scene.resolveFramebuffers(y), {
        context: m,
        _pickOffscreenView: a,
        picking: o,
        ray: p,
        cameraUp: f,
        boundingRectangle: c,
        pickBoundingRectangle: h
      }
    }
    _endFrame({
      context: e
    }) {
      this._viewer.scene.view = this._viewer.scene.defaultView, e.endFrame()
    }
    _pickColorsInPolygon(e, i) {
      const {
        context: n,
        _pickOffscreenView: s,
        pickBoundingRectangle: {
          width: o,
          height: a
        }
      } = this._startFrame(e, i), c = n.readPixels({
        x: 0,
        y: 0,
        width: o,
        height: a,
        framebuffer: s.pickFramebuffer._fb._framebuffer._framebuffer ? s.pickFramebuffer._fb._framebuffer : s.pickFramebuffer._fb
      }), h = Bg(c);
      return this._endFrame({
        context: n
      }), {
        colors: h,
        context: n
      }
    }
    pickPointsInPolygon(e, i = .1) {
      const {
        context: n,
        _pickOffscreenView: s,
        picking: o,
        ray: a,
        boundingRectangle: {
          width: c,
          height: h
        },
        pickBoundingRectangle: {
          width: u,
          height: d
        }
      } = this._startFrame(e, i), p = [];
      if (n.depthTexture) {
        const f = s.frustumCommandsList.length,
          m = new l.Cartesian3;
        for (let g = 0; g < f; ++g) {
          const y = o.getPickDepth(this._viewer.scene, g),
            x = Lg(n, 0, 0, u, d, y);
          for (let A = 0; A < x.length; A++) {
            const _ = x[A];
            if (_ > 0 && _ < 1) {
              const v = s.frustumCommandsList[g],
                b = v.near * (A !== 0 ? this._viewer.scene.opaqueFrustumNearOffset : 1),
                {
                  far: C
                } = v,
                M = b + _ * (C - b),
                S = Math.floor(A / u),
                H = A % u,
                N = (S - d / 2) * h / d,
                w = (H - u / 2) * c / u,
                E = new l.Cartesian3;
              l.Cartesian3.multiplyByScalar(s.camera.up, N, m), l.Cartesian3.add(m, s.camera.position, E), l.Cartesian3.multiplyByScalar(s.camera.right, w, m), l.Cartesian3.add(m, E, E);
              const B = l.Ray.clone(a);
              B.origin = E;
              const T = l.Ray.getPoint(B, M);
              !p[A] && (p[A] = T)
            }
          }
        }
      }
      return this._endFrame({
        context: n
      }), p.map(f => {
        if (!f) return;
        const m = new R(f);
        if (m.isInPolygon(e)) return m
      }).filter(Boolean)
    }
    pickHighestPointInPolygon(...e) {
      return this.pickPointsInPolygon(...e).sort((s, o) => o.height - s.height)[0]
    }
    pickFeaturesInPolygon(e, i) {
      const {
        colors: n,
        context: s
      } = this._pickColorsInPolygon(e, i);
      return n.map(o => s.getObjectByPickColor(o)).filter(Boolean)
    }
    _updateOffscreenCamera(e, i, n, s, o) {
      const a = l.Cartesian3.cross(e.direction, i, new l.Cartesian3);
      n.position = e.origin, n.direction = e.direction, n.up = i, n.right = a, n.frustum.width = s, n.frustum.aspectRatio = s / o, n.frustum.computeCullingVolume(n.positionWC, n.directionWC, n.upWC)
    }
  }

  function Bg(r) {
    const e = r.length / 4,
      i = [];
    for (let n = 0; n < e; n++) {
      const s = n * 4,
        o = r[s] / 255,
        a = r[s + 1] / 255,
        c = r[s + 2] / 255,
        h = r[s + 3] / 255,
        u = new l.Color(o, a, c, h);
      !i.find(p => l.Color.equals(p, u)) && i.push(u)
    }
    return i
  }

  function Lg(r, e, i, n, s, o) {
    const a = r.readPixels({
        x: e,
        y: i,
        width: n,
        height: s,
        framebuffer: o._framebuffer._framebuffer._bind ? o._framebuffer._framebuffer : o._framebuffer
      }),
      c = l.Cartesian4.unpackArray(a),
      h = [];
    for (let u = 0; u < c.length; ++u) {
      const d = c[u];
      l.Cartesian4.divideByScalar(d, 255, d), h.push(l.Cartesian4.dot(d, Og))
    }
    return h
  }
  class ll extends Ig {
    constructor(e, o = {}) {
      var a = o,
        {
          viewer: i,
          scenes: n = []
        } = a,
        s = re(a, ["viewer", "scenes"]);
      super();
      P(this, "graphics", []);
      P(this, "styleConver", Ae);
      P(this, "_cancelFpCb", () => {});
      P(this, "_drawTool", null);
      P(this, "_measureTool", null);
      P(this, "_pickTool", null);
      P(this, "_tooltip", null);
      P(this, "_picking");
      if (!e) {
        console.error("dom\u4E0D\u80FD\u4E3A\u7A7A");
        return
      }
      this.imageBuilder = new Dg, this.options = ne($s, s), Ur(this, Op), Ur(this, eg), Ur(this, bm), this.options.baseMaps && this.initBaseMaps(this.options), this.init(e, this.options, i)
    }
    get frameNumber() {
      try {
        return this.viewer.scene.context._us.frameState.frameNumber
      } catch {
        return 0
      }
    }
    get level() {
      return this.getLevelByHeight(new R(this.viewer.camera.positionWC).height)
    }
    getLevelByHeight(e) {
      const i = 40487.57,
        n = 7096758e-11,
        s = 91610.74,
        o = -40467.74;
      return Math.max(0, Math.min(+(o + (i - o) / (1 + Math.pow(e / s, n))).toFixed(0), 24))
    }
    get rectangle() {
      return this.viewer.camera.computeViewRectangle()
    }
    get bbox() {
      const e = this.rectangle,
        [i, n] = new R(l.Rectangle.northeast(e)).toLatLngArray(),
        [s, o] = new R(l.Rectangle.southwest(e)).toLatLngArray();
      return [s, o, i, n]
    }
    get rectangles() {
      const {
        west: e,
        south: i,
        east: n,
        north: s
      } = this.rectangle;
      return [new l.Rectangle(e, i, n, i + (s - i) / 3), new l.Rectangle(e, i + (s - i) / 3, n, i + (s - i) / 3 * 2), new l.Rectangle(e, i + (s - i) / 3 * 2, n, s)]
    }
    get globe() {
      return this.viewer.scene.globe
    }
    get camera() {
      return this.viewer.camera
    }
    get scene() {
      return this.viewer.scene
    }
    setOptions({
      scene: e,
      cameraControllerType: i,
      center: n,
      clock: s,
      navigationHelpButton: o,
      navigationInstructionsInitiallyVisible: a,
      keyboardRoaming: c,
      tokenConfig: h,
      effect: u,
      control: d,
      geocoder: p,
      imagerLayers: f,
      defaultTemplateValues: m,
      resolutionScale: g,
      clip: y,
      shadows: x
    } = {}) {
      var _;
      U(c) && this.setKeyboardRoaming(c), U(i) && this.setCameraController(i);
      let A;
      e && (A = e.terrainProvider, delete e.terrainProvider, this._recursionSet({
        scene: e
      }, this.viewer)), s && this._recursionSet({
        clock: s
      }, this.viewer), n && this.flyToViewPoint(n), U(o) && (o ? this.navigationHelpButton || (this.navigationHelpButton = new _t({
        instructionsInitiallyVisible: a
      })) : ((_ = this.navigationHelpButton) == null || _.destroy(), this.navigationHelpButton = null)), ge(h) && Ws(et, h), ge(u) && this.setEffectOptions(u), ge(d) && this.setControlOptions(d), U(p) && this.setGeocoder(p), U(A) && this.setTerrainProvider(A), Ie(f) && this.setImagerLayers(f), m && (l.Resource.defaultTemplateValues = m), U(g) && (this.viewer.resolutionScale = g), U(y) && this.clip(y.points || y.positions, y.style), U(x) && (this.viewer.shadows = x)
    }
    setKeyboardRoaming(e, i) {
      this._keyboardRoaming && (this._keyboardRoaming.destroy(), this._keyboardRoaming = null), e && (this._keyboardRoaming = new xg(this, i)), this._keyboardRoaming && (this._keyboardRoaming.enable = e)
    }
    setFirstPerson(e, {
      height: i = 1.8,
      tiles: n = [],
      objectsToExclude: s = []
    } = {}) {
      const o = (a, c) => {
        const h = new l.Ray(c, l.Cartesian3.subtract(new R(c, {
            setHeight: -100
          }), c, new l.Cartesian3)),
          u = this.viewer.scene.pickFromRay(h, s.map(p => p.entity || p.primitive || p));
        if (!u) return !0;
        const d = l.Cartesian3.distance(c, u.position);
        if (u && u.object && u.object instanceof l.Cesium3DTileFeature && n.includes(u.object.getProperty("id"))) {
          let p;
          if (Math.abs(d - i) > .01) {
            this.viewer.camera.move(l.Cartesian3.UNIT_Z, i - d);
            const f = l.Cartesian3.subtract(a, c, new l.Cartesian3);
            p = l.Transforms.eastNorthUpToFixedFrame(l.Cartesian3.add(this.viewer.camera.positionWC, f, new l.Cartesian3))
          } else p = l.Transforms.eastNorthUpToFixedFrame(c);
          return this.viewer.camera.lookAtTransform(p), !1
        }
        return !0
      };
      if (this.setKeyboardRoaming(e, {
          moveRate: 150,
          rotateAxis: l.Cartesian3.UNIT_Z,
          enCollision: !0,
          collision: o,
          afterMove: () => {
            const a = l.Transforms.eastNorthUpToFixedFrame(this.viewer.camera.positionWC);
            this.viewer.camera.lookAtTransform(a)
          }
        }), e) {
        const a = this.viewer.scene.screenSpaceCameraController._minimumRotateRate,
          c = this.viewer.scene.screenSpaceCameraController.enableZoom,
          h = this.viewer.camera.frustum.fov;
        this.viewer.scene.screenSpaceCameraController._minimumRotateRate = 1.77, this.viewer.scene.screenSpaceCameraController.enableZoom = !1, o(this.camera.positionWC, this.camera.positionWC);
        let u = this.on("wheel", d => {
          if (d > 0) {
            const p = this.viewer.camera.frustum.fov - .1;
            this.viewer.camera.frustum.fov = p < 0 ? p + .1 : p
          } else this.viewer.camera.frustum.fov + .1 > h ? this.viewer.camera.frustum.fov = h : this.viewer.camera.frustum.fov += .1
        });
        this._cancelFpCb = () => {
          u && (u(), u = null), this.viewer.camera.frustum.fov = h, this.viewer.scene.screenSpaceCameraController._minimumRotateRate = a, this.viewer.scene.screenSpaceCameraController.enableZoom = c, this.viewer.camera.lookAtTransform(l.Matrix4.IDENTITY)
        }
      } else this._cancelFpCb(), this._cancelFpCb = () => {}
    }
    get drawTool() {
      return (!this._drawTool || this._drawTool.isDestroyed) && (this._drawTool = new No({
        map: this
      })), this._drawTool
    }
    get measureTool() {
      return (!this._measureTool || this._measureTool.isDestroyed) && (this._measureTool = new Ko({
        map: this
      })), this._measureTool
    }
    get pickTool() {
      return (!this._pickTool || this._pickTool.isDestroyed) && (this._pickTool = new Jo({
        map: this
      })), this._pickTool
    }
    get tooltip() {
      return this._tooltip ? this._tooltip : (this._tooltip = new zg({
        style: {
          html: ""
        },
        map: this
      }), this._tooltip)
    }
    destroy() {
      this.imageBuilder && this.imageBuilder.destroy(), [...this.graphics].forEach(e => {
        e == null || e.destroy()
      }), this.viewer.destroy(), super.destroy(), this.viewer = null
    }
    setGeocoder(e) {
      var s, o;
      if (ge(e)) return;
      e === !1 ? (s = this.container.querySelector(".cesium-viewer-geocoderContainer")) == null || s.setAttribute("style", "display:none") : (o = this.container.querySelector(".cesium-viewer-geocoderContainer")) == null || o.setAttribute("style", "display:inline-block");
      const n = {
        gaode: nl,
        baidu: sl,
        tdt: ol
      } [e];
      n && (this.viewer.geocoder.viewModel._geocoderServices = [new n])
    }
    init(e, o, s) {
      var a = o,
        {
          graphics: i
        } = a,
        n = re(a, ["graphics"]);
      ge(n.tokenConfig) && Ws(et, n.tokenConfig), this.viewer = s || new Sg(e, n), this._initEvent({
        viewer: this.viewer,
        optimizeEvents: n.optimizeEvents
      }), this.setOptions(j({}, n)), i && this.addGraphic(i), this.viewer.camera._flyHomeBack = this.viewer.camera.flyHome, this.viewer.camera.flyHome = this.flyHome.bind(this)
    }
    _recursionSet(e, i) {
      for (const n in e) ge(e[n]) && e[n].constructor === Object ? i && this._recursionSet(e[n], i[n]) : Re(n) && n.toLowerCase().endsWith("color") ? i[n] = e[n] instanceof l.Color ? e[n] : l.Color.fromCssColorString(e[n]) : i[n] = e[n]
    }
    flyToViewPoint(e, i = {}) {
      var d, p;
      if (Re(e) && (e = (p = (d = this.options.viewPoints) == null ? void 0 : d.find(m => m.label === e)) == null ? void 0 : p.value, !e)) return;
      const f = e,
        {
          x: n,
          y: s,
          z: o,
          heading: a,
          roll: c,
          pitch: h
        } = f,
        u = re(f, ["x", "y", "z", "heading", "roll", "pitch"]);
      return new Promise(m => {
        this.viewer.camera.flyTo(se(j(j({
          destination: l.Cartesian3.fromDegrees(n, s, o),
          orientation: {
            heading: l.Math.toRadians(l.defaultValue(a, 0)),
            pitch: l.Math.toRadians(l.defaultValue(h, 0)),
            roll: l.Math.toRadians(l.defaultValue(c, 0))
          }
        }, u), i), {
          complete() {
            requestAnimationFrame(m)
          }
        }))
      })
    }
    getViewPoint() {
      const e = this.viewer,
        i = hh(e.camera.position),
        {
          heading: n,
          roll: s,
          pitch: o
        } = e.camera;
      return {
        heading: l.Math.toDegrees(n),
        roll: l.Math.toDegrees(s),
        pitch: l.Math.toDegrees(o),
        x: i.x,
        y: i.y,
        z: i.z
      }
    }
    getCurrentView() {
      const e = this.getCenterPoint();
      if (!e) return;
      const i = this.viewer.camera;
      return {
        center: e,
        distance: l.Cartesian3.distance(e, i.position),
        rotate: 360 - l.Math.toDegrees(i.heading),
        tilt: l.Math.toDegrees(-i.pitch)
      }
    }
    getGraphic(e) {
      return Vr("graphics", this, i => i.id === e)
    }
    getAllGraphics() {
      return Nr("graphics", this)
    }
    addGraphics(e) {
      return e.map(i => this.addGraphic(i))
    }
    addGraphic(e) {
      if (e instanceof Array) return e.map(n => this.addGraphic(n));
      if (!(e instanceof it)) {
        const i = e,
          {
            type: n,
            on: s
          } = i,
          o = re(i, ["type", "on"]),
          a = Hi[n];
        if (!a) {
          console.warn(`\u4E0D\u5B58\u5728type\u4E3A${n}\u7684graphic`);
          return
        }
        e = new a(o), s && Object.entries(s).forEach(([c, h]) => {
          e.on(c, h)
        })
      }
      return e.entity && this.viewer.entities.add(e.entity), e.primitive && (e.loadPromise ? e.loadPromise.then(() => {
        this.viewer.scene.primitives.add(e.primitive)
      }) : this.viewer.scene.primitives.add(e.primitive)), e.dataSource && this.viewer.dataSources.add(e.dataSource), this.graphics.push(e), e._parent = this, e._onAddToMap(this), e
    }
    removeGraphic(e) {
      if (e instanceof Array) {
        e.forEach(n => {
          this.removeGraphic(n)
        });
        return
      }
      e instanceof it || (e = this.getGraphic(e));
      const i = this.graphics.findIndex(n => n === e);
      i !== -1 && (e.entity && this.viewer.entities.remove(e.entity), e.primitive && this.viewer.scene.primitives.remove(e.primitive), e.dataSource && this.viewer.dataSources.remove(e.dataSource), e.primitiveCollection && this.viewer.scene.primitives.remove(e.primitiveCollection), this.graphics.splice(i, 1), me.DESTROYED !== e.state && e.destroy())
    }
    flyHome() {
      this.options.center ? this.flyToViewPoint(this.options.center) : this.viewer.camera._flyHomeBack()
    }
    flyToPoint(e, i = {}, n = {}) {
      this.viewer.camera.flyTo(j({
        destination: new R(e),
        orientation: i
      }, n))
    }
    flyToGraphic(e, i = {}) {
      e instanceof it || (e = this.getGraphic(e));
      let n;
      e.boundingSphere && (n = e.boundingSphere), !n && e.center && (n = new l.BoundingSphere(e.center, 0)), !!n && this.flyToBoundingSphere(n, i)
    }
    flyToPoints(e, i) {
      this.flyToBoundingSphere(l.BoundingSphere.fromPoints(e.map(n => new R(n))), i)
    }
    flyToBoundingSphere(e, i = {}) {
      if (Ie(e)) {
        const n = e.length;
        e = l.BoundingSphere.fromPoints([new R(e.slice(0, n / 2)), new R(e.slice(n / 2, n))])
      }
      this.viewer.camera.flyToBoundingSphere(e, j({
        offset: {
          heading: l.Math.toRadians(l.defaultValue(i.heading, 0)),
          pitch: l.Math.toRadians(l.defaultValue(i.pitch, -90)),
          range: i.radius || 0
        }
      }, i))
    }
    setCameraType({
      type: e = "gs",
      transformX: i = 10,
      transformZ: n = 0,
      keepHeadUp: s = !1,
      graphic: o = {}
    } = {}) {
      const a = o.entity || o;
      switch (this._setCameraType_desFunc && (this._setCameraType_desFunc(), this._setCameraType_desFunc = null), e) {
        default:
          console.error("type \u53EA\u80FD\u4E3A gs dy sd none reset");
          break;
        case "none":
        case "reset":
          this.viewer.trackedEntity = null;
          break;
        case "gs":
          this.viewer.trackedEntity !== a && (this.viewer.trackedEntity = a);
          break;
        case "dy":
          this.viewer.trackedEntity !== a && (this.viewer.trackedEntity = a), this._setCameraType_desFunc = this.on("preRender", () => {
            this.viewer.scene.camera.lookAtTransform(this._getEntityMatrix(a, s), new l.Cartesian3(-i, 0, n))
          });
          break;
        case "sd":
          this.viewer.trackedEntity != a && (this.viewer.trackedEntity = a), this._setCameraType_desFunc = this.on("preRender", () => {
            this.viewer.scene.camera.lookAtTransform(this._getEntityMatrix(a), new l.Cartesian3(-1, 0, n))
          });
          break
      }
    }
    _getEntityMatrix(e, i) {
      const n = this.viewer.clock.currentTime,
        s = l.Property.getValueOrUndefined(e.position, n, new l.Cartesian3);
      if (!l.defined(s)) return;
      let o;
      const a = l.Property.getValueOrUndefined(e.orientation, n, new l.Quaternion);
      if (!l.defined(a)) o = this._fixedFrameTransform(s, void 0, new l.Matrix4);
      else if (o = l.Matrix4.fromRotationTranslation(l.Matrix3.fromQuaternion(a, new l.Matrix3), s, new l.Matrix4), i) {
        const c = l.Transforms.fixedFrameToHeadingPitchRoll(o);
        return c.pitch = 0, l.Transforms.headingPitchRollToFixedFrame(s, c)
      }
      return o
    }
    _fixedFrameTransform(...e) {
      return l.Transforms.eastNorthUpToFixedFrame(...e)
    }
    getScreenCenterPX() {
      const i = this.viewer.scene.canvas;
      return new l.Cartesian2(i.clientWidth / 2, i.clientHeight / 2)
    }
    getCenterPoint() {
      return this.getPointFromScreenPX(this.getScreenCenterPX())
    }
    getPointFromScreenPX(e) {
      let n = this.viewer.scene.pickPosition(e);
      return n || (n = this.viewer.camera.pickEllipsoid(e)), n && new R(n)
    }
    setCursor(e) {
      this.container.style.cursor = e
    }
    get container() {
      return this.viewer._container.querySelector(".cesium-viewer")
    }
    zoomIn() {
      return this.zoom(.5)
    }
    zoom(e) {
      const i = this.viewer.camera,
        n = this.getCenterPoint(),
        s = l.Cartesian3.subtract(i.position, n, new l.Cartesian3),
        o = l.Cartesian3.multiplyByScalar(s, e, s),
        a = l.Cartesian3.add(n, o, n);
      return new Promise(c => {
        i.flyTo({
          destination: a,
          duration: 1,
          orientation: {
            heading: i.heading,
            pitch: i.pitch,
            roll: i.roll
          },
          complete() {
            requestAnimationFrame(c)
          }
        })
      })
    }
    zoomOut() {
      return this.zoom(2)
    }
    rotateStart(n = {}) {
      var s = n,
        {
          type: e = "point"
        } = s,
        i = re(s, ["type"]);
      this._rotateInstance && (this._rotateInstance.stop(), this._rotateInstance.destroy(), this._rotateInstance = null);
      const o = {
        point: bg,
        around: Ag,
        globe: Pg
      };
      o[e] && (this._rotateInstance = new o[e](this, i), this._rotateInstance.start())
    }
    get isRotating() {
      return !!this._rotateInstance
    }
    rotateStop() {
      this._rotateInstance && (this._rotateInstance.stop(), this._rotateInstance.destroy(), this._rotateInstance = null)
    }
    setSkyBox(e, {
      ground: i = !1,
      suffix: n
    } = {}) {
      var s;
      if (U(e) && !(e instanceof l.SkyBox)) {
        const o = i ? "sky-box-ground" : "sky-box",
          a = l.buildModuleUrl(`../img/${o}`),
          c = i ? mg : l.SkyBox,
          h = {
            "sky-box-ground": {
              lantian: "jpg"
            },
            "sky-box": {
              5: "jpg"
            }
          };
        n = (s = n != null ? n : h[o][e]) != null ? s : "png", e = new c({
          sources: {
            positiveX: `${a}/${e}/px.${n}`,
            negativeX: `${a}/${e}/nx.${n}`,
            positiveY: `${a}/${e}/py.${n}`,
            negativeY: `${a}/${e}/ny.${n}`,
            positiveZ: `${a}/${e}/pz.${n}`,
            negativeZ: `${a}/${e}/nz.${n}`
          }
        })
      }
      this.viewer.scene.skyBox = e
    }
    get isFullscreen() {
      return l.Fullscreen.fullscreen
    }
    fullScreen() {
      l.Fullscreen.requestFullscreen(document.body)
    }
    fullScreenEarth() {
      l.Fullscreen.requestFullscreen(this.viewer.scene.canvas)
    }
    exitFullscreen() {
      l.Fullscreen.exitFullscreen()
    }
    forbidGAllGraphicEvent(e = []) {
      this.getAllGraphics().filter(n => !e.includes(n)).forEach(n => {
        n.forbidEvent = !0
      })
    }
    unForbidGAllGraphicEvent(e = []) {
      this.getAllGraphics().filter(n => !e.includes(n)).forEach(n => {
        n.forbidEvent = !1
      })
    }
    changeMode(e) {
      const n = {
        "2d": l.SceneMode.SCENE2D,
        "3d": l.SceneMode.SCENE3D
      } [e];
      ce(n) || (this.viewer.scene.mode = n)
    }
    enableCameraControl() {
      this.viewer.scene.screenSpaceCameraController.enableInputs = !0
    }
    disableCameraControl() {
      this.viewer.scene.screenSpaceCameraController.enableInputs = !1
    }
    setTerrainProvider(e) {
      var i, n;
      if (e || (e = new l.EllipsoidTerrainProvider({
          ellipsoid: l.Ellipsoid.WGS84
        })), (n = (i = e.constructor) == null ? void 0 : i.name) == null ? void 0 : n.endsWith("TerrainProvider")) {
        this.viewer.scene.terrainProvider = e;
        return
      }
      Re(e) && (e.includes("layer.json") && (e = e.replace(/layer.json/, "")), e = {
        url: e
      }), this.viewer.scene.terrainProvider = new l.CesiumTerrainProvider(e)
    }
    getBoundingSphere(e) {
      let i = [];
      return Ie(e) ? i = e.map(n => n.entity || n) : i = [e.entity || e], i.length ? l.BoundingSphere.fromBoundingSpheres(i.map(n => {
        const s = new l.BoundingSphere;
        return this.viewer._dataSourceDisplay.getBoundingSphere(n, !1, s), s
      })) : null
    }
    getPxMeter(e) {
      const i = this.viewer,
        n = i.scene,
        s = new l.BoundingSphere(new R(e), .5);
      return i.camera.getPixelSize(s, n.context.drawingBufferWidth, n.context.drawingBufferHeight)
    }
    setCameraController(e, i = {}) {
      this._cameraControlClass && (this._cameraControlClass.destroy(), this._cameraControlClass = null);
      const s = {
        three: Eg,
        indoor: Tg,
        track: Mg
      } [e];
      !s || (this._cameraControlClass = new s(j({
        map: this
      }, i)))
    }
    intersection(e, i) {
      if (!e || !i) return;
      i instanceof l.Plane || (i = l.Plane.fromPointNormal(i, l.Cartesian3.normalize(i, new l.Cartesian3))), e instanceof l.Cartesian2 && (e = this.viewer.camera.getPickRay(e)), e instanceof l.Cartesian3 && (e = new l.Ray(this.viewer.camera.positionWC, e));
      const n = l.IntersectionTests.rayPlane(e, i);
      return n && new R(n)
    }
    collision(e, i, {
      distance: n = .1
    } = {}) {
      const s = new l.Ray(e, l.Cartesian3.subtract(i, e, new l.Cartesian3)),
        o = this.viewer.scene.pickFromRay(s, this.getAllGraphics().filter(a => a.type === "point").map(a => a.entity));
      if (o && o.position) {
        const a = l.Cartesian3.distance(e, o.position),
          c = l.Cartesian3.distance(e, i);
        if (a - c < n) return !0
      }
      return !1
    }
    openEditor() {
      const e = window.open(this.options.editorUrl);
      window.addEventListener("message", async i => {
        try {
          if (i.data.eventName === "ready") {
            const n = {
              graphics: [{
                attr: {
                  name: "\u573A\u666F",
                  isTop: !0
                },
                type: "group",
                graphics: await Promise.all(this.graphics.map(s => s.toJSON()))
              }],
              center: se(j({}, this.getViewPoint()), {
                duration: 0
              })
            };
            console.log("data", n), e.postMessage({
              eventName: "sceneData",
              data: n
            }, "*")
          }
        } catch (n) {
          console.log(n)
        }
      }, !1)
    }
    get isRealVisible() {
      return !0
    }
    screenShot() {
      return this.viewer.scene.render(), this.viewer.scene.canvas.toDataURL()
    }
    clip(e, i) {
      this.globeClip && (this.globeClip.destroy(), this.globeClip = null), !!(e && e.length) && (this.globeClip = new Li({
        target: this.globe,
        transform: l.Matrix4.IDENTITY,
        map: this,
        style: i
      }).clip(e.reverse().map(n => new R(n))))
    }
    setSunLightByTime(e, {
      intensity: i = 2,
      color: n = l.Color.WHITE
    } = {}) {
      e = e instanceof l.JulianDate ? e : l.JulianDate.fromDate($r(e).toDate());
      const s = l.Transforms.computeTemeToPseudoFixedMatrix(e, new l.Matrix3),
        o = l.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(e instanceof l.JulianDate ? e : l.JulianDate.fromDate($r(e).toDate()), new l.Cartesian3);
      l.Matrix3.multiplyByVector(s, o, o), this.viewer.scene.light = new l.DirectionalLight({
        color: n instanceof l.Color ? n : l.Color.fromCssColorString(n),
        direction: l.Cartesian3.negate(o, o),
        intensity: i
      })
    }
    get picking() {
      return this._picking || (this._picking = new Rg(this.viewer)), this._picking
    }
  }

  function Gg(r, e) {
    let i = r._usesDepthTexture,
      n = r._polygonOffsetSupported,
      s = r._isPointLight,
      o = r._isSpotLight,
      a = r._numberOfCascades > 1,
      c = r.debugCascadeColors,
      h = r.softShadows,
      u = "";
    s ? u += `#define USE_CUBE_MAP_SHADOW
` : i && (u += `#define USE_SHADOW_DEPTH_TEXTURE
`), h && !s && (u += `#define USE_SOFT_SHADOWS
`);
    let d = `struct sg_shadowParameters{ 
        #ifdef USE_CUBE_MAP_SHADOW

            vec3 texCoords;

        #else

            vec2 texCoords;

        #endif

            float depthBias;
            float depth;
            float nDotL;
            vec2 texelStepSize;
            float normalShadingSmooth;
            float darkness;
        };
`,
      p = `#ifdef USE_CUBE_MAP_SHADOW
float sg_sampleShadowMap(samplerCube shadowMap, vec3 d)
{
    return czm_unpackDepth(textureCube(shadowMap, d));
}
float sg_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
    return step(depth, sg_sampleShadowMap(shadowMap, uv));
}
float sg_shadowVisibility(samplerCube shadowMap, sg_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec3 uvw = shadowParameters.texCoords;

    depth -= depthBias;
    float visibility = sg_shadowDepthCompare(shadowMap, uvw, depth);
    return visibility;
}
#else
float sg_sampleShadowMap(sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
    return texture2D(shadowMap, uv).r;
#else
    return czm_unpackDepth(texture2D(shadowMap, uv));
#endif
}
float sg_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
    return step(depth, sg_sampleShadowMap(shadowMap, uv));
}
float sg_shadowVisibility(sampler2D shadowMap, sg_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec2 uv = shadowParameters.texCoords;

    depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
    vec2 texelStepSize = shadowParameters.texelStepSize;
    float radius = 1.0;
    float dx0 = -texelStepSize.x * radius;
    float dy0 = -texelStepSize.y * radius;
    float dx1 = texelStepSize.x * radius;
    float dy1 = texelStepSize.y * radius;
    float visibility = (
        sg_shadowDepthCompare(shadowMap, uv, depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
        sg_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
    ) * (1.0 / 9.0);
#else
    float visibility = sg_shadowDepthCompare(shadowMap, uv, depth);
#endif

    return visibility;
}
#endif
`,
      f = `vec4 getPositionEC(float depth) 
{ 
    vec2 xy = vec2((v_textureCoordinates.x * 2.0 - 1.0), (v_textureCoordinates.y * 2.0 - 1.0));
    float z = (depth - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
    vec4 posInCamera = czm_inverseProjection * vec4(xy, z, 1.0);
    posInCamera = posInCamera / posInCamera.w;
    return posInCamera;
} 
`;
    return u += `uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
`, s ? u += `uniform samplerCube shadowMap_textureCube; 
` : u += `uniform sampler2D shadowMap_texture; 
`, u += `uniform mat4 shadowMap_matrix; 
uniform vec3 shadowMap_lightDirectionEC; 
uniform vec4 shadowMap_lightPositionEC; 
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; 
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; 
uniform vec4 viewShed_frontColor; 
uniform vec4 viewShed_backColor; 
uniform float viewShed_Fov; 
uniform float viewShed_Far;

varying vec2 v_textureCoordinates;

${d}${p}${f}vec3 getNormalEC() 
{ 
    return vec3(1.0); 
} 

`, u += `void main() 
{ 
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    if(depth > 0.999999)
    {
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return;
    }
    vec4 positionEC = getPositionEC(depth); 
    vec3 normalEC = getNormalEC(); 
    float z = -positionEC.z; 
`, u += `    sg_shadowParameters shadowParameters; 
    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; 
    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; 
    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; 
    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; 
`, e ? u += `    shadowParameters.depthBias *= max(z * 0.01, 1.0); 
` : n || (u += `    shadowParameters.depthBias *= mix(1.0, 100.0, z * 0.0015); 
`), s ? u += `    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    directionEC = normalize(directionEC); 
    float radius = shadowMap_lightPositionEC.w; 
    // Stop early if the fragment is beyond the point light radius 
    if (distance > radius) 
    { 
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return; 
    } 
    vec3 directionWC  = czm_inverseViewRotation * directionEC; 
    shadowParameters.depth = distance / radius; 
    shadowParameters.texCoords = directionWC; 
    float visibility = sg_shadowVisibility(shadowMap_textureCube, shadowParameters); 
` : o ? u += `    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    if(distance > viewShed_Far)
    {
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return;
    }
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Spot light uses a perspective projection, so perform the perspective divide 
    shadowPosition /= shadowPosition.w; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    float visibility = sg_shadowVisibility(shadowMap_texture, shadowParameters); 
` : a ? u += `    float maxDepth = shadowMap_cascadeSplits[1].w; 
    // Stop early if the eye depth exceeds the last cascade 
    if (z > maxDepth) 
    { 
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return; 
    } 
    // Get the cascade based on the eye-space z 
    vec4 weights = czm_cascadeWeights(z); 
    // Transform position into the cascade 
    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; 
    // Get visibility 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    float visibility = sg_shadowVisibility(shadowMap_texture, shadowParameters); 
    // Fade out shadows that are far away 
    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; 
    float fade = max((z - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); 
    visibility = mix(visibility, 1.0, fade); 
` : u += `    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    float visibility = sg_shadowVisibility(shadowMap_texture, shadowParameters); 
`, u += `    vec4 color = texture2D(colorTexture, v_textureCoordinates);
${a&&c?`    color *= czm_cascadeColor(weights); 
`:""}    if(visibility > 0.0) 
        gl_FragColor = vec4(color.rgb * (1.0 - viewShed_frontColor.a) + viewShed_frontColor.rgb * viewShed_frontColor.a, color.a); 
    else 
        gl_FragColor = vec4(color.rgb * (1.0 - viewShed_backColor.a) + viewShed_backColor.rgb * viewShed_backColor.a, color.a); 
} 
`, u
  }
  class cl {
    constructor(e, i) {
      const n = e.viewer;
      if (!l.defined(n)) throw new l.DeveloperError("\u7F3A\u5C11\u5730\u56FE\u5BF9\u8C61\uFF01");
      this.options = i || {}, this._map = e, this._scene = n.scene;
      let s = i.cameraOptions || {};
      this._enabled = l.defaultValue(i.enabled, !0), this._position = new R(i.position), this._heading = l.defaultValue(s.heading, 0), this._pitch = l.defaultValue(s.pitch, 0), this._horizontalFov = l.defaultValue(s.horizontalFov, 120), this._verticalFov = l.defaultValue(s.verticalFov, 60), this._distance = l.defaultValue(s.distance, 100), this._visibleAreaColor = s.visibleAreaColor instanceof l.Color ? s.visibleAreaColor : l.Color.fromCssColorString(s.visibleAreaColor), this._visibleAreaColorAlpha = s.visibleAreaColorAlpha == null ? 1 : s.visibleAreaColorAlpha, this._hiddenAreaColor = s.hiddenAreaColor instanceof l.Color ? s.hiddenAreaColor : l.Color.fromCssColorString(s.hiddenAreaColor), this._hiddenAreaColorAlpha = s.hiddenAreaColorAlpha == null ? 1 : s.hiddenAreaColorAlpha, this._size = l.defaultValue(i.size, 2048), this._softShadows = l.defaultValue(i.softShadows, !0), this.updateBugDistance(), this._outlineColor = l.defaultValue(i.outlineColor, l.Color.YELLOW), this._lightCameraPrimitive = void 0, this._lightCamera = new l.Camera(this._scene), this._lightCameraDirty = !1, this._stage = void 0, this._stageDirty = !0, this.updateCamera(), this._shadowMap = new l.ShadowMap({
        context: this._scene.context,
        lightCamera: this._lightCamera,
        enabled: this._enabled,
        isPointLight: !1,
        pointLightRadius: 100,
        cascadesEnabled: !1,
        size: this._size,
        softShadows: this._softShadows,
        normalOffset: !1,
        fromLightSource: !1
      }), this._bias = this._shadowMap._primitiveBias, e.viewer.scene.primitives.add(this)
    }
    get enabled() {
      return this._enabled
    }
    set enabled(e) {
      this._enabled = e, this._shadowMap.enabled = e
    }
    get softShadows() {
      return this._softShadows
    }
    set softShadows(e) {
      this._softShadows = e, this._shadowMap.softShadows = e
    }
    get size() {
      return this._size
    }
    set size(e) {
      this.size = e, this._shadowMap.size = e
    }
    get visibleAreaColor() {
      return l.Color.fromCartesian4(this._visibleAreaColor)
    }
    set visibleAreaColor(e) {
      let i = e instanceof l.Color ? e : l.Color.fromCssColorString(e);
      this._visibleAreaColor = i, this._scene.requestRender()
    }
    get visibleAreaColorAlpha() {
      return this._visibleAreaColorAlpha
    }
    set visibleAreaColorAlpha(e) {
      this._visibleAreaColorAlpha = Number(e), this._scene.requestRender()
    }
    get hiddenAreaColorAlpha() {
      return this._hiddenAreaColorAlpha
    }
    set hiddenAreaColorAlpha(e) {
      this._hiddenAreaColorAlpha = Number(e), this._scene.requestRender()
    }
    get hiddenAreaColor() {
      return l.Color.fromCartesian4(this._hiddenAreaColor)
    }
    set hiddenAreaColor(e) {
      let i = e instanceof l.Color ? e : l.Color.fromCssColorString(e);
      this._hiddenAreaColor = i, this._scene.requestRender()
    }
    get position() {
      return this._position
    }
    set position(e) {
      this._position = new R(e), this._lightCameraDirty = !0, this._scene.requestRender()
    }
    get heading() {
      return this._heading
    }
    set heading(e) {
      this._heading = e, this._lightCameraDirty = !0, this._scene.requestRender()
    }
    get pitch() {
      return this._pitch
    }
    set pitch(e) {
      this._pitch = e, this._lightCameraDirty = !0, this._scene.requestRender()
    }
    get horizontalFov() {
      return this._horizontalFov
    }
    set horizontalFov(e) {
      e >= 180 && (e = 179), e <= 0 && (e = .1), this._horizontalFov = e, this.updateBugDistance(), this._lightCameraDirty = !0, this._scene.requestRender()
    }
    get verticalFov() {
      return this._verticalFov
    }
    set verticalFov(e) {
      this._verticalFov = e, this.updateBugDistance(), this._lightCameraDirty = !0, this._scene.requestRender()
    }
    get distance() {
      return this._distance
    }
    set distance(e) {
      this._distance = e, this.updateBugDistance(), this._lightCameraDirty = !0, this._scene.requestRender()
    }
    updateBugDistance() {
      const e = this._distance + 1e-6 * this._horizontalFov - 1e-6 * this._verticalFov;
      this._bugDistance = e >= 0 ? e : 1e-6
    }
    updateCamera() {
      this._lightCamera.frustum.near = .001 * this._bugDistance, this._lightCamera.frustum.far = this._bugDistance, this._lightCamera.frustum.fov = l.Math.toRadians(this._verticalFov);
      const e = l.Math.toRadians(this._horizontalFov),
        i = l.Math.toRadians(this._verticalFov);
      this._lightCamera.frustum.aspectRatio = this._bugDistance * Math.tan(e * .5) * 2 / (this._bugDistance * Math.tan(i * .5) * 2), this._horizontalFov > this._verticalFov && (this._lightCamera.frustum.fov = l.Math.toRadians(this._horizontalFov)), this._lightCamera.setView({
        destination: this._position,
        orientation: {
          heading: l.Math.toRadians(this._heading),
          pitch: l.Math.toRadians(this._pitch)
        }
      }), this._lightCameraPrimitive && (this._lightCameraPrimitive.destroy(), this._lightCameraPrimitive = void 0);
      let n = this.createOutLineGeometry();
      this._lightCameraPrimitive = new l.Primitive({
        geometryInstances: new l.GeometryInstance({
          geometry: n,
          attributes: {
            color: l.ColorGeometryInstanceAttribute.fromColor(this._outlineColor)
          }
        }),
        appearance: new l.PerInstanceColorAppearance({
          translucent: !1,
          flat: !0
        }),
        modelMatrix: this._lightCamera.inverseViewMatrix,
        asynchronous: !1
      }), this._lightCameraDirty = !1
    }
    createOutLineGeometry() {
      let e = new Float32Array(633);
      var i, n, s, o, a = e,
        c = l.Math.toRadians(this._horizontalFov),
        h = l.Math.toRadians(this._verticalFov),
        u = Math.tan(.5 * c),
        d = Math.tan(.5 * h);
      n = this._distance * u, o = this._distance * d, i = -n, s = -o;
      let p = 0;
      a[p++] = 0, a[p++] = 0, a[p++] = 0;
      let f, m, g = Math.PI - .5 * c,
        y = c / 4;
      for (let C = 0; C < 5; ++C) {
        f = g + C * y;
        let M = o / (this._distance / Math.cos(f)),
          S = Math.atan(M),
          H = -S,
          N = S / 10;
        for (let w = 0; w < 21; ++w) m = H + w * N, a[p++] = this._distance * Math.cos(m) * Math.sin(f), a[p++] = this._distance * Math.sin(m), a[p++] = this._distance * Math.cos(m) * Math.cos(f)
      }
      y = c / 20;
      for (let C = 0; C < 21; ++C) {
        f = g + C * y;
        let M = o / (this._distance / Math.cos(f)),
          S = Math.atan(M),
          H = -S,
          N = S / 2;
        for (let w = 0; w < 5; ++w) m = H + w * N, a[p++] = this._distance * Math.cos(m) * Math.sin(f), a[p++] = this._distance * Math.sin(m), a[p++] = this._distance * Math.cos(m) * Math.cos(f)
      }
      let x = new l.GeometryAttributes({
          position: new l.GeometryAttribute({
            componentDatatype: l.ComponentDatatype.DOUBLE,
            componentsPerAttribute: 3,
            values: e
          })
        }),
        A = new Uint16Array(408),
        _ = A,
        v = 0;
      _[v++] = 0, _[v++] = 1, _[v++] = 0, _[v++] = 21, _[v++] = 0, _[v++] = 85, _[v++] = 0, _[v++] = 105;
      for (var i = 0, b = 0; b < 5; ++b) {
        i++;
        for (let M = 0; M < 20; ++M) _[v++] = i++, _[v++] = i
      }
      i++;
      for (var s = 0; s < 20; ++s)
        for (let M = 0; M < 5; ++M) _[v++] = i, _[v++] = i++ + 5;
      return new l.Geometry({
        attributes: x,
        indices: A,
        primitiveType: l.PrimitiveType.LINES,
        boundingSphere: l.BoundingSphere.fromVertices(e)
      })
    }
    updateStage() {
      if (!this._stageDirty) return;
      this._stageDirty = !1, l.defined(this._stage) && (this._scene.postProcessStages.remove(this._stage), this._stage = void 0);
      let e = new l.Cartesian2,
        i = this._bias,
        n = this._shadowMap,
        s = this,
        o = {
          shadowMap_texture() {
            return n._shadowMapTexture
          },
          shadowMap_matrix() {
            return n._shadowMapMatrix
          },
          viewShed_frontColor() {
            let c = s._visibleAreaColor.withAlpha(s._visibleAreaColorAlpha);
            return c = l.Cartesian4.fromColor(c), c
          },
          viewShed_backColor() {
            let c = s._hiddenAreaColor.withAlpha(s._hiddenAreaColorAlpha);
            return c = l.Cartesian4.fromColor(c), c
          },
          viewShed_Far() {
            return n._lightCamera.frustum.far
          },
          shadowMap_lightheadingEC() {
            return n._lightheadingEC
          },
          shadowMap_lightPositionEC() {
            return n._lightPositionEC
          },
          shadowMap_texelSizeDepthBiasAndNormalShadingSmooth() {
            let c = e;
            return c.x = 1 / n._textureSize.x, c.y = 1 / n._textureSize.y, l.Cartesian4.fromElements(c.x, c.y, i.depthBias, i.normalShadingSmooth, this.combinedUniforms1)
          },
          shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness() {
            return l.Cartesian4.fromElements(i.normalOffsetScale, n._distance, n.maximumDistance, n._darkness, this.combinedUniforms2)
          },
          combinedUniforms1: new l.Cartesian4,
          combinedUniforms2: new l.Cartesian4
        },
        a = Gg(n, !1);
      this._stage = new l.PostProcessStage({
        fragmentShader: a,
        uniforms: o
      }), this._scene.postProcessStages.add(this._stage)
    }
    update(e) {
      this._lightCameraDirty && this.updateCamera(), this.updateStage(), e.shadowMaps.push(this._shadowMap), this._lightCameraPrimitive && this._distance > 0 && this._lightCameraPrimitive.update(e)
    }
    destroy() {
      this._stage && (this._scene.postProcessStages.remove(this._stage), this._stage = void 0), this._shadowMap && (this._shadowMap.destroy(), this._shadowMap = null), this._lightCameraPrimitive && (this._lightCameraPrimitive.destroy(), this._lightCameraPrimitive = void 0), this._map && (this._map.viewer.scene.primitives.remove(this), this._map = null, this._scene = null)
    }
  }
  class Fg {
    constructor({
      map: e
    }) {
      P(this, "invert", !1);
      this._map = e
    }
    start({
      style: e
    } = {}) {
      let i = null;
      return this._map.once("click", n => {
        i = n.point;
        const s = this.vf = new cl(this._map, {
            position: i,
            cameraOptions: j({
              visibleAreaColor: "#00FF00",
              visibleAreaColorAlpha: 1,
              hiddenAreaColor: "#FF0000",
              hiddenAreaColorAlpha: 1,
              verticalFov: 60,
              horizontalFov: 120,
              heading: 300,
              distance: 0
            }, e)
          }),
          o = this._map.on("mousemove", a => {
            const c = a.point.distance(i),
              h = this.computeAngle(i.toLatLng(), a.point.toLatLng());
            s.heading = h, s.distance = c
          });
        this._map.once("click", a => {
          const c = a.point.distance(i),
            h = this.computeAngle(i.toLatLng(), a.point.toLatLng());
          s.heading = h, s.distance = c, o()
        })
      }), this
    }
    destroy() {
      this.vf && (this.vf.destroy(), this.vf = null), this._map = null
    }
    computeAngle(e, i) {
      if (!e || !i) return;
      let n = e.lng,
        s = e.lat,
        o = i.lng,
        a = i.lat,
        c = Math.sin(o - n) * Math.cos(a),
        h = Math.cos(s) * Math.sin(a) - Math.sin(s) * Math.cos(a) * Math.cos(o - n),
        u = Math.atan2(c, h);
      return u = u * 180 / Math.PI, u < -180 && (u = u + 360), u = u % 360, this.invert ? u : 360 - u
    }
  }
  var Hg = Object.freeze({
      __proto__: null,
      [Symbol.toStringTag]: "Module",
      DrawTool: No,
      MeasureTool: Ko,
      PickTool: Jo,
      PositionEdit: Lr,
      AnalysisTool: Fg
    }),
    Ng = Object.freeze({
      __proto__: null,
      [Symbol.toStringTag]: "Module",
      VisualField: cl
    });
  const Ug = function (r) {
    const e = `a${Math.random().toString(36).slice(-6)}`;
    return window.__VAPSEarthCb || (window.__VAPSEarthCb = {}), window.__VAPSEarthCb[e] = r, `__VAPSEarthCb.${e}()`
  };
  var Vg = Object.freeze({
    __proto__: null,
    [Symbol.toStringTag]: "Module",
    getElementOnclickStr: Ug
  });
  const Wg = r => l.BoundingSphere.fromPoints(r).center,
    jg = (r, e) => l.Cartesian3.distance(new R(r), new R(e)),
    qg = r => {
      const e = document.createElement("img");
      return e.src = r, new Promise(i => {
        e.onload = () => {
          i(e)
        }
      })
    },
    Qg = (r, e) => {
      const i = r.map(s => new R(s).toLatLngArray()),
        n = Ih(fr(i), e);
      return Ah(n)
    },
    Yg = (r, {
      turningMetre: e = 1,
      num: i = 100,
      format: n = s => s
    } = {}) => {
      if (r.length < 3) return r;
      r = r.map(o => new R(o));
      const s = [n(r[0])];
      for (let o = 1; o < r.length - 1; o++) {
        const a = r[o],
          c = r[o - 1],
          h = r[o + 1];
        if (l.Cartesian3.equals(a, c) || l.Cartesian3.equals(a, h) || l.Cartesian3.equals(c, h)) continue;
        const u = l.Cartesian3.distance(a, c);
        let d = l.Cartesian3.lerp(c, a, 1 - Math.min(.5, e / u), new l.Cartesian3);
        l.Cartesian3.distance(a, d) > u && (d = c);
        const p = l.Cartesian3.distance(a, h);
        let f = l.Cartesian3.lerp(h, a, 1 - Math.min(.5, e / p), new l.Cartesian3);
        l.Cartesian3.distance(a, f) > p && (f = h);
        let m = l.Cartesian3.midpoint(d, f, new l.Cartesian3);
        m = l.Cartesian3.lerp(a, m, .35, m);
        const g = new l.CatmullRomSpline({
          times: [0, .5, 1],
          points: [d, m, f],
          firstTangent: l.Cartesian3.ZERO,
          lastTangent: l.Cartesian3.ZERO
        });
        for (let y = 0; y < i; y++) s.push(n(new R(g.evaluate(1 / (i - 1) * y)), !(y === 0 || y === i - 1), y))
      }
      return s.push(n(r[r.length - 1])), s
    },
    Xg = function (r, {
      maxHeight: e = 100,
      count: i = 100
    } = {}) {
      const [n, s] = r.map(c => {
        const h = new R(c).toMercator();
        return [h.x, h.y, h.z]
      });
      let o = [],
        a = [(n[0] + s[0]) / 2, (n[1] + s[1]) / 2, (n[2] + s[2]) / 2];
      a[2] += e * 2;
      for (let c = 0; c <= i; c++) {
        let h = c / i,
          u = (1 - h) * (1 - h) * n[0] + 2 * (1 - h) * h * a[0] + h * h * s[0],
          d = (1 - h) * (1 - h) * n[1] + 2 * (1 - h) * h * a[1] + h * h * s[1],
          p = (1 - h) * (1 - h) * n[2] + 2 * (1 - h) * h * a[2] + h * h * s[2];
        o.push([u, d, p])
      }
      return o.map(c => R.fromMercator({
        x: c[0],
        y: c[1],
        z: c[2]
      }))
    };
  var Kg = Object.freeze({
      __proto__: null,
      [Symbol.toStringTag]: "Module",
      pointIsInPolygon: ts,
      diffBy: Oi,
      getPolygonCenter: Wg,
      distance: jg,
      getLoadedImage: qg,
      smoothLine: Qg,
      smoothLineAngle: Yg,
      calculateParabola: Xg
    }),
    s0 = "";
  const hl = "1.1.99.1";
  let ul = j({
    name: "VAPSEarth",
    defaultConfig: $s,
    version: hl,
    graphic: df,
    control: xm,
    tool: Hg,
    analysis: Ng,
    helper: Vg,
    util: Kg,
    Point: R,
    Map: ll,
    tokenConfig: et,
    geocoder: Cg,
    PlaneClip: Li
  }, Uh);
  return console.log(`VAPS Earth version ${hl}`), window.VE = ul, ul
});
